decord/source/7780_setMeasurement.js

55 lines
1.8 KiB
JavaScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 7780
// Function ID: 7781
2026-07-29 08:29:29 +00:00
// Name: setMeasurement
2026-08-15 05:55:55 +00:00
// Dependencies: [7743, 7766, 7738, 7753]
2026-07-29 08:29:29 +00:00
2026-08-15 05:55:55 +00:00
// Module 7780 (setMeasurement)
2026-07-29 08:29:29 +00:00
const require = arg1;
const dependencyMap = arg6;
arg5.setMeasurement = function setMeasurement(arg0, arg1, arg2) {
let activeSpan = arg3;
if (arg3 === undefined) {
2026-08-15 05:55:55 +00:00
let obj = require(7743) /* spanTimeInputToSeconds */;
2026-07-29 08:29:29 +00:00
activeSpan = obj.getActiveSpan();
}
let rootSpan = activeSpan;
if (activeSpan) {
2026-08-15 05:55:55 +00:00
rootSpan = require(7743) /* spanTimeInputToSeconds */.getRootSpan(activeSpan);
const obj3 = require(7743) /* spanTimeInputToSeconds */;
2026-07-29 08:29:29 +00:00
}
if (rootSpan) {
2026-08-15 05:55:55 +00:00
if (require(7766) /* __SENTRY_DEBUG__ */.DEBUG_BUILD) {
const logger = tmp9(7738).logger;
2026-07-29 08:29:29 +00:00
const _HermesInternal = HermesInternal;
logger.log("[Measurement] Setting measurement on root span: " + arg0 + " = " + arg1 + " " + arg2);
}
obj = {};
2026-08-15 05:55:55 +00:00
obj[require(7753).SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE] = arg1;
obj[require(7753).SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT] = arg2;
2026-07-29 08:29:29 +00:00
rootSpan.addEvent(arg0, obj);
}
};
arg5.timedEventsToMeasurements = function timedEventsToMeasurements(arr) {
if (arr) {
if (0 !== arr.length) {
let obj = {};
const item = arr.forEach((attributes) => {
const tmp = attributes.attributes || {};
const tmp2 = tmp[obj(undefined, outer1_1[3]).SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT];
const tmp3 = tmp[obj(undefined, outer1_1[3]).SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE];
2026-08-04 21:03:28 +00:00
let tmp4 = typeof tmp2 === "string";
if (typeof tmp2 === "string") {
tmp4 = typeof tmp3 === "number";
2026-07-29 08:29:29 +00:00
}
if (tmp4) {
obj = { value: null, unit: null };
obj[0] = tmp3;
obj[1] = tmp2;
obj[attributes.name] = obj;
}
});
return obj;
}
}
};