decord/source/__polyfill/12xxx/module_12969.js
github-actions a36fe4ec9c chore: update source for alpha 347.0
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-14 20:04:03 +00:00

55 lines
1.8 KiB
JavaScript

// Module ID: 12969
// Function ID: 12970
// Dependencies: [12932, 12955, 12927, 12942]
// Exports: setMeasurement, timedEventsToMeasurements
// Module 12969
import spanTimeInputToSeconds from "spanTimeInputToSeconds" /* 12932 */;
import _mod12942 from "module_12942" /* 12942 */;
import _mod12955 from "module_12955" /* 12955 */;
require = arg1;
const dependencyMap = arg6;
export const setMeasurement = function setMeasurement(arg0, arg1, arg2) {
let activeSpan = arg3;
if (arg3 === undefined) {
activeSpan = spanTimeInputToSeconds.getActiveSpan();
}
let rootSpan = activeSpan;
if (activeSpan) {
rootSpan = spanTimeInputToSeconds.getRootSpan(activeSpan);
}
if (rootSpan) {
if (_mod12955.DEBUG_BUILD) {
const logger = tmp9(12927).logger;
const _HermesInternal = HermesInternal;
logger.log("[Measurement] Setting measurement on root span: " + arg0 + " = " + arg1 + " " + arg2);
}
const obj2 = {};
obj2[_mod12942.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE] = arg1;
obj2[_mod12942.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT] = arg2;
rootSpan.addEvent(arg0, obj2);
}
};
export const timedEventsToMeasurements = function timedEventsToMeasurements(arr) {
if (arr) {
if (0 !== arr.length) {
let obj = {};
const item = arr.forEach((attributes) => {
const tmp = attributes.attributes || {};
const tmp2 = tmp[_mod12942.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT];
const tmp3 = tmp[_mod12942.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE];
let tmp4 = typeof tmp2 === "string";
if (typeof tmp2 === "string") {
tmp4 = typeof tmp3 === "number";
}
if (tmp4) {
obj = { value: tmp3, unit: tmp2 };
obj[attributes.name] = obj;
}
});
return obj;
}
}
};