decord/source/modules/monitoring/MonitoringAgent.tsx

160 lines
4.6 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 5839
// Function ID: 51399
2026-07-20 16:05:17 +00:00
// Name: set
2026-07-25 08:10:48 +00:00
// Dependencies: [6, 7, 653, 477, 5840, 5841, 27, 5842, 5843, 507, 2]
2026-07-20 16:05:17 +00:00
2026-07-25 08:10:48 +00:00
// Module 5839 (set)
2026-07-23 10:11:24 +00:00
import getActivityIndicator from "get ActivityIndicator";
import enforcing from "enforcing";
import { Endpoints } from "ME";
import set from "ME";
const require = arg1;
let set = new Set(["darwin", "linux", "win32", "ios", "android"]);
let obj = { COUNT: "count", DISTRIBUTION: "distribution" };
let tmp3 = (() => {
2026-07-20 16:05:17 +00:00
class MonitoringAgent {
constructor() {
2026-07-23 10:11:24 +00:00
self = this;
tmp = outer1_2(this, self);
2026-07-20 16:05:17 +00:00
this._metrics = [];
this._intervalId = setInterval(() => {
self._flush();
}, 120000);
2026-07-23 10:11:24 +00:00
tmp2 = MonitoringAgent(outer1_1[6]);
obj = MonitoringAgent(outer1_1[3]);
2026-07-20 16:05:17 +00:00
if (obj.isAndroid()) {
tmp3 = MonitoringAgent;
2026-07-23 10:11:24 +00:00
tmp4 = outer1_1;
2026-07-20 16:05:17 +00:00
num = 7;
2026-07-23 10:11:24 +00:00
MetricMonitor = MonitoringAgent(outer1_1[7]).default;
2026-07-20 16:05:17 +00:00
} else {
MetricMonitor = tmp2.NativeModules.MetricMonitor;
}
nativeEventEmitter = new tmp2.NativeEventEmitter(MetricMonitor);
addListenerResult = nativeEventEmitter.addListener("logMetric", (arg0) => {
self.increment(arg0, false);
});
return;
}
}
let obj = {
key: "_getMetricWithDefaults",
value(name, type) {
2026-07-23 10:11:24 +00:00
let tags = name.tags;
const obj = { name: name.name, type, tags: MonitoringAgent(outer1_1[8]).getGlobalTagsArray() };
2026-07-20 16:05:17 +00:00
if (null != tags) {
const item = tags.forEach((arg0) => {
const tags = obj.tags;
tags.push(arg0);
});
}
2026-07-23 10:11:24 +00:00
const obj2 = MonitoringAgent(outer1_1[8]);
2026-07-20 16:05:17 +00:00
let str = "web";
if (!obj3.isWeb()) {
2026-07-23 10:11:24 +00:00
const platformName = MonitoringAgent(outer1_1[3]).getPlatformName();
2026-07-20 16:05:17 +00:00
let tmp6 = null;
2026-07-23 10:11:24 +00:00
if (outer1_5.has(platformName)) {
2026-07-20 16:05:17 +00:00
tmp6 = platformName;
}
str = tmp6;
2026-07-23 10:11:24 +00:00
const obj4 = MonitoringAgent(outer1_1[3]);
2026-07-20 16:05:17 +00:00
}
if (null != str) {
const tags1 = obj.tags;
const _HermesInternal = HermesInternal;
tags1.push("platform:" + str);
}
2026-07-23 10:11:24 +00:00
const CurrentReleaseChannel = MonitoringAgent(outer1_1[4]).CurrentReleaseChannel;
2026-07-20 16:05:17 +00:00
let tmp9 = null;
if (null != CurrentReleaseChannel) {
2026-07-23 10:11:24 +00:00
const ALL = MonitoringAgent(outer1_1[5]).ReleaseChannelsSets.ALL;
2026-07-20 16:05:17 +00:00
tmp9 = null;
if (ALL.has(CurrentReleaseChannel)) {
tmp9 = CurrentReleaseChannel;
}
}
if (null != tmp9) {
const tags2 = obj.tags;
const _HermesInternal2 = HermesInternal;
tags2.push("release_channel:" + tmp9);
}
return obj;
}
};
2026-07-23 10:11:24 +00:00
let items = [obj, , , ];
2026-07-20 16:05:17 +00:00
obj = {
key: "increment",
value(arg0) {
let flag = arg1;
const self = this;
if (arg1 === undefined) {
flag = false;
}
const _metrics = self._metrics;
2026-07-23 10:11:24 +00:00
_metrics.push(self._getMetricWithDefaults(arg0, outer1_6.COUNT));
2026-07-20 16:05:17 +00:00
if (!flag) {
flag = self._metrics.length >= 100;
}
if (flag) {
self._flush();
}
}
};
items[1] = obj;
obj = {
key: "distribution",
value(arg0, arg1) {
let flag = arg2;
const self = this;
if (arg2 === undefined) {
flag = false;
}
const obj = {};
2026-07-23 10:11:24 +00:00
const merged = Object.assign(self._getMetricWithDefaults(arg0, outer1_6.DISTRIBUTION));
2026-07-20 16:05:17 +00:00
obj["value"] = arg1;
const _metrics = self._metrics;
_metrics.push(obj);
if (!flag) {
flag = self._metrics.length >= 100;
}
if (flag) {
self._flush();
}
}
};
items[2] = obj;
items[3] = {
key: "_flush",
value() {
2026-07-23 10:11:24 +00:00
let self = this;
self = this;
2026-07-20 16:05:17 +00:00
if (this._metrics.length > 0) {
2026-07-23 10:11:24 +00:00
let items = [];
2026-07-20 16:05:17 +00:00
HermesBuiltin.arraySpread(self._metrics, 0);
2026-07-23 10:11:24 +00:00
const HTTP = MonitoringAgent(outer1_1[9]).HTTP;
let obj = { url: outer1_4.METRICS_V2 };
2026-07-25 08:10:48 +00:00
obj = { metrics: items, client_info: { built_at: "1784956800514", build_number: "6075" } };
2026-07-20 16:05:17 +00:00
obj.body = obj;
obj.retries = 1;
obj.rejectWithError = true;
HTTP.post(obj).catch(() => {
if (self._metrics.length + items.length < 100) {
2026-07-23 10:11:24 +00:00
items = [];
2026-07-20 16:05:17 +00:00
HermesBuiltin.arraySpread(items, HermesBuiltin.arraySpread(self._metrics, 0));
self._metrics = items;
}
});
const postResult = HTTP.post(obj);
}
self._metrics = [];
}
};
return callback(MonitoringAgent, items);
2026-07-23 10:11:24 +00:00
})();
2026-07-20 16:05:17 +00:00
tmp3 = new tmp3();
2026-07-23 10:11:24 +00:00
const result = set.fileFinishedImporting("modules/monitoring/MonitoringAgent.tsx");
2026-07-20 16:05:17 +00:00
export default tmp3;
export const MetricType = obj;