decord/source/929_captureMetric.js

51 lines
1.2 KiB
JavaScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 929
2026-07-25 08:10:48 +00:00
// Function ID: 10113
2026-07-20 16:05:17 +00:00
// Name: captureMetric
2026-07-23 10:11:24 +00:00
// Dependencies: [861]
2026-07-20 16:05:17 +00:00
// Module 929 (captureMetric)
2026-07-23 10:11:24 +00:00
const require = arg1;
const dependencyMap = arg6;
2026-07-20 16:05:17 +00:00
function captureMetric(distribution, name, value, unit) {
2026-07-23 10:11:24 +00:00
let obj = require(861) /* setMetricAttribute */;
2026-07-20 16:05:17 +00:00
obj = { type: distribution, name, value };
unit = undefined;
if (null != unit) {
unit = unit.unit;
}
obj.unit = unit;
let attributes;
if (null != unit) {
attributes = unit.attributes;
}
obj.attributes = attributes;
obj = {};
let scope;
if (null != unit) {
scope = unit.scope;
}
obj.scope = scope;
const result = obj._INTERNAL_captureMetric(obj, obj);
}
Object.defineProperty(arg5, Symbol.toStringTag, { value: "Module" });
arg5.count = function count(arg0) {
let num = 1;
if (arguments.length > 1) {
num = 1;
if (undefined !== arguments[1]) {
num = arguments[1];
}
}
let tmp2;
if (arguments.length > 2) {
tmp2 = arguments[2];
}
captureMetric("counter", arg0, num, tmp2);
};
arg5.distribution = function distribution(name, value, unit) {
captureMetric("distribution", name, value, unit);
};
arg5.gauge = function gauge(name, value, unit) {
captureMetric("gauge", name, value, unit);
};