decord/source/__polyfill/12xxx/module_12990.js
github-actions 03cf168fbc chore: update source for alpha 347.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4825.js (118.4 MB)
2026-09-17 08:17:09 +00:00

55 lines
1.8 KiB
JavaScript

// Module ID: 12990
// Function ID: 12991
// Dependencies: [12953, 12976, 12948, 12963]
// Exports: setMeasurement, timedEventsToMeasurements
// Module 12990
import spanTimeInputToSeconds from "spanTimeInputToSeconds" /* 12953 */;
import _mod12963 from "module_12963" /* 12963 */;
import _mod12976 from "module_12976" /* 12976 */;
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 (_mod12976.DEBUG_BUILD) {
const logger = tmp9(12948).logger;
const _HermesInternal = HermesInternal;
logger.log("[Measurement] Setting measurement on root span: " + arg0 + " = " + arg1 + " " + arg2);
}
const obj2 = {};
obj2[_mod12963.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE] = arg1;
obj2[_mod12963.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[_mod12963.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT];
const tmp3 = tmp[_mod12963.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;
}
}
};