decord/source/838_setMeasurement.js

55 lines
2.1 KiB
JavaScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 838
2026-07-25 08:10:48 +00:00
// Function ID: 9327
2026-07-20 16:05:17 +00:00
// Name: setMeasurement
2026-07-23 10:11:24 +00:00
// Dependencies: [77, 796, 800, 801, 816]
2026-07-20 16:05:17 +00:00
// Exports: setMeasurement, timedEventsToMeasurements
// Module 838 (setMeasurement)
2026-07-23 10:11:24 +00:00
import _defineProperty from "_defineProperty";
2026-07-20 16:05:17 +00:00
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
export const setMeasurement = function setMeasurement(arg0, arg1, arg2) {
if (arguments.length > 3) {
if (undefined !== arguments[3]) {
let activeSpan = arguments[3];
}
let rootSpan = activeSpan;
if (activeSpan) {
2026-07-23 10:11:24 +00:00
rootSpan = require(796) /* convertSpanLinksForEnvelope */.getRootSpan(activeSpan);
const obj3 = require(796) /* convertSpanLinksForEnvelope */;
2026-07-20 16:05:17 +00:00
}
if (rootSpan) {
2026-07-23 10:11:24 +00:00
if (require(800).DEBUG_BUILD) {
const debug = require(801) /* consoleSandbox */.debug;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
debug.log("[Measurement] Setting measurement on root span: " + arg0 + " = " + arg1 + " " + arg2);
}
2026-07-23 10:11:24 +00:00
rootSpan.addEvent(arg0, _defineProperty(_defineProperty({}, require(816).SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE, arg1), require(816).SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT, arg2));
const tmp16 = _defineProperty({}, require(816).SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE, arg1);
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
activeSpan = require(796) /* convertSpanLinksForEnvelope */.getActiveSpan();
2026-07-20 16:05:17 +00:00
};
export const timedEventsToMeasurements = function timedEventsToMeasurements(arr) {
if (arr) {
if (0 !== arr.length) {
2026-07-23 10:11:24 +00:00
let obj = {};
2026-07-20 16:05:17 +00:00
const item = arr.forEach((attributes) => {
const tmp = attributes.attributes || {};
2026-07-23 10:11:24 +00:00
const tmp2 = tmp[obj(undefined, outer1_1[4]).SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT];
const tmp3 = tmp[obj(undefined, outer1_1[4]).SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE];
2026-07-20 16:05:17 +00:00
let tmp4 = "string" === typeof tmp2;
if (tmp4) {
tmp4 = "number" === typeof tmp3;
}
if (tmp4) {
2026-07-23 10:11:24 +00:00
obj = { value: tmp3, unit: tmp2 };
2026-07-20 16:05:17 +00:00
obj[attributes.name] = obj;
}
});
return obj;
}
}
};