decord/source/__polyfill/12xxx/module_12869.js
github-actions e510164e6b chore: update source for alpha 346.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4759.js (118.4 MB)
2026-09-10 05:38:07 +00:00

55 lines
1.8 KiB
JavaScript

// Module ID: 12869
// Function ID: 12870
// Dependencies: [12832, 12855, 12827, 12842]
// Exports: setMeasurement, timedEventsToMeasurements
// Module 12869
import spanTimeInputToSeconds from "spanTimeInputToSeconds" /* 12832 */;
import _mod12842 from "module_12842" /* 12842 */;
import _mod12855 from "module_12855" /* 12855 */;
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 (_mod12855.DEBUG_BUILD) {
const logger = tmp9(12827).logger;
const _HermesInternal = HermesInternal;
logger.log("[Measurement] Setting measurement on root span: " + arg0 + " = " + arg1 + " " + arg2);
}
const obj2 = {};
obj2[_mod12842.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE] = arg1;
obj2[_mod12842.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[_mod12842.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT];
const tmp3 = tmp[_mod12842.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;
}
}
};