decord/source/modules/libdiscore/timerUtils.tsx

54 lines
2 KiB
TypeScript
Raw Normal View History

2026-08-28 06:19:39 +00:00
// Module ID: 17436
// Function ID: 17437
2026-07-29 08:29:29 +00:00
// Name: onTimersDelayCallback
2026-08-28 06:19:39 +00:00
// Dependencies: [676, 3, 698, 636, 1922, 2]
2026-07-20 16:05:17 +00:00
// Exports: setupLibdiscoreTimersMonitor
2026-08-28 06:19:39 +00:00
// Module 17436 (onTimersDelayCallback)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import timestampDefault from "timestamp" /* 3 */;
import debounceDefault from "debounce" /* 636 */;
import ME from "ME" /* 676 */;
import expandEventPropertiesDefault from "expandEventProperties" /* 698 */;
2026-08-28 06:19:39 +00:00
import setTimeoutAll from "setTimeout" /* 1922 */;
2026-07-23 10:11:24 +00:00
2026-07-20 16:05:17 +00:00
function onTimersDelayCallback(timerId, expectedDelay, actualDelay, executionTime) {
2026-07-29 08:29:29 +00:00
let obj = { timerId, expectedDelay, actualDelay, executionTime };
arr = arr.push(obj);
2026-07-20 16:05:17 +00:00
if (arr.length >= 10) {
2026-07-29 08:29:29 +00:00
if (0 !== arr.length) {
const _HermesInternal = HermesInternal;
2026-08-24 06:08:38 +00:00
logger.warn("[libdiscore.timers] Flushing " + arr.length + " delay logs", arr);
2026-07-29 08:29:29 +00:00
obj = { delay_reports: null };
const _JSON = JSON;
obj[0] = JSON.stringify(arr);
2026-08-24 06:08:38 +00:00
expandEventPropertiesDefault.track(AnalyticEvents.LIBDISCORE_SLOW_TIMERS, obj);
2026-07-29 08:29:29 +00:00
arr = [];
2026-08-24 06:08:38 +00:00
const obj2 = expandEventPropertiesDefault;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
} else {
callback();
}
}
2026-08-24 06:08:38 +00:00
const AnalyticEvents = ME.AnalyticEvents;
let closure_4 = new timestampDefault("libdiscore.timers");
2026-07-20 16:05:17 +00:00
let closure_5 = [];
2026-08-24 06:08:38 +00:00
let closure_6 = debounceDefault(function flushDelayLogs() {
2026-07-29 08:29:29 +00:00
if (0 !== arr.length) {
const _HermesInternal = HermesInternal;
2026-08-24 06:08:38 +00:00
logger.warn("[libdiscore.timers] Flushing " + arr.length + " delay logs", arr);
let obj = expandEventPropertiesDefault;
2026-07-29 08:29:29 +00:00
obj = { delay_reports: null };
const _JSON = JSON;
obj[0] = JSON.stringify(arr);
obj.track(AnalyticEvents.LIBDISCORE_SLOW_TIMERS, obj);
arr = [];
}
}, 5000);
2026-08-24 06:08:38 +00:00
const tmp2 = new timestampDefault("libdiscore.timers");
let result = set.fileFinishedImporting("modules/libdiscore/timerUtils.tsx");
2026-07-20 16:05:17 +00:00
export const setupLibdiscoreTimersMonitor = function setupLibdiscoreTimersMonitor() {
2026-08-24 06:08:38 +00:00
const result = setTimeoutAll.setTimersMonitorCallback(onTimersDelayCallback);
2026-07-20 16:05:17 +00:00
};