69 lines
3.4 KiB
JavaScript
69 lines
3.4 KiB
JavaScript
// Metro module 1063 (f1064).
|
|
import { browserPerformanceTimeOrigin } from "./Module817";
|
|
import { extractNetworkProtocol, getBrowserPerformanceAPI } from "./Module1059";
|
|
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
value: "Module"
|
|
});
|
|
export function resourceTimingToSpanAttributes(a0) {
|
|
let r33;
|
|
const r6 = {};
|
|
if (a0.nextHopProtocol != null) {
|
|
const r19 = extractNetworkProtocol(a0.nextHopProtocol);
|
|
const name = r19.name;
|
|
r6["network.protocol.version"] = r19.version;
|
|
r6["network.protocol.name"] = name;
|
|
}
|
|
L57: {
|
|
if (!browserPerformanceTimeOrigin()) {
|
|
const timeOrigin = getBrowserPerformanceAPI()?.timeOrigin;
|
|
r33 = r6;
|
|
if (!timeOrigin) {
|
|
break L57;
|
|
}
|
|
}
|
|
const redirectStart = a0.redirectStart;
|
|
const r36 = redirectStart && ((browserPerformanceTimeOrigin() || performance.timeOrigin) + redirectStart) / 1000;
|
|
const redirectEnd = a0.redirectEnd;
|
|
const r44 = redirectEnd && ((browserPerformanceTimeOrigin() || performance.timeOrigin) + redirectEnd) / 1000;
|
|
const workerStart = a0.workerStart;
|
|
const r54 = workerStart && ((browserPerformanceTimeOrigin() || performance.timeOrigin) + workerStart) / 1000;
|
|
const fetchStart = a0.fetchStart;
|
|
const r64 = fetchStart && ((browserPerformanceTimeOrigin() || performance.timeOrigin) + fetchStart) / 1000;
|
|
const domainLookupStart = a0.domainLookupStart;
|
|
const r74 = domainLookupStart && ((browserPerformanceTimeOrigin() || performance.timeOrigin) + domainLookupStart) / 1000;
|
|
const domainLookupEnd = a0.domainLookupEnd;
|
|
const r84 = domainLookupEnd && ((browserPerformanceTimeOrigin() || performance.timeOrigin) + domainLookupEnd) / 1000;
|
|
const connectStart = a0.connectStart;
|
|
const r94 = connectStart && ((browserPerformanceTimeOrigin() || performance.timeOrigin) + connectStart) / 1000;
|
|
const secureConnectionStart = a0.secureConnectionStart;
|
|
const r104 = secureConnectionStart && ((browserPerformanceTimeOrigin() || performance.timeOrigin) + secureConnectionStart) / 1000;
|
|
const connectEnd = a0.connectEnd;
|
|
const r114 = connectEnd && ((browserPerformanceTimeOrigin() || performance.timeOrigin) + connectEnd) / 1000;
|
|
const requestStart = a0.requestStart;
|
|
const r124 = requestStart && ((browserPerformanceTimeOrigin() || performance.timeOrigin) + requestStart) / 1000;
|
|
const responseStart = a0.responseStart;
|
|
const r134 = responseStart && ((browserPerformanceTimeOrigin() || performance.timeOrigin) + responseStart) / 1000;
|
|
const responseEnd = a0.responseEnd;
|
|
r33 = Object.fromEntries(Object.entries({
|
|
...r6,
|
|
"http.request.redirect_start": r36,
|
|
"http.request.redirect_end": r44,
|
|
"http.request.worker_start": r54,
|
|
"http.request.fetch_start": r64,
|
|
"http.request.domain_lookup_start": r74,
|
|
"http.request.domain_lookup_end": r84,
|
|
"http.request.connect_start": r94,
|
|
"http.request.secure_connection_start": r104,
|
|
"http.request.connection_end": r114,
|
|
"http.request.request_start": r124,
|
|
"http.request.response_start": r134,
|
|
"http.request.response_end": responseEnd && ((browserPerformanceTimeOrigin() || performance.timeOrigin) + responseEnd) / 1000,
|
|
"http.request.time_to_first_byte": a0.responseStart != null ? a0.responseStart / 1000 : void 0
|
|
}).filter((item) => {
|
|
const [, r2] = item;
|
|
return r2 != null;
|
|
}));
|
|
}
|
|
return r33;
|
|
}
|