decord/source/modules/libdiscore/timerUtils.tsx

39 lines
1.3 KiB
TypeScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 16684
// Function ID: 130101
2026-07-20 16:05:17 +00:00
// Name: flushDelayLogs
2026-07-25 08:10:48 +00:00
// Dependencies: [653, 3, 675, 574, 1849, 2]
2026-07-20 16:05:17 +00:00
// Exports: setupLibdiscoreTimersMonitor
2026-07-27 11:26:19 +00:00
// Module 16684 (flushDelayLogs)
2026-07-23 10:11:24 +00:00
import { AnalyticEvents } from "ME";
import importDefaultResult from "debounce";
2026-07-20 16:05:17 +00:00
function flushDelayLogs() {
if (0 !== arr.length) {
const _HermesInternal = HermesInternal;
importDefaultResult.warn("[libdiscore.timers] Flushing " + arr.length + " delay logs", arr);
2026-07-23 10:11:24 +00:00
let obj = importDefault(675);
2026-07-20 16:05:17 +00:00
obj = {};
const _JSON = JSON;
obj.delay_reports = JSON.stringify(arr);
obj.track(AnalyticEvents.LIBDISCORE_SLOW_TIMERS, obj);
2026-07-23 10:11:24 +00:00
arr = [];
2026-07-20 16:05:17 +00:00
}
}
function onTimersDelayCallback(timerId, expectedDelay, actualDelay, executionTime) {
2026-07-23 10:11:24 +00:00
arr = arr.push({ timerId, expectedDelay, actualDelay, executionTime });
2026-07-20 16:05:17 +00:00
if (arr.length >= 10) {
flushDelayLogs();
} else {
callback();
}
}
importDefaultResult = new importDefaultResult("libdiscore.timers");
let closure_5 = [];
2026-07-23 10:11:24 +00:00
let closure_6 = require("debounce")(flushDelayLogs, 5000);
let result = require("expandLocation").fileFinishedImporting("modules/libdiscore/timerUtils.tsx");
2026-07-20 16:05:17 +00:00
export const setupLibdiscoreTimersMonitor = function setupLibdiscoreTimersMonitor() {
2026-07-25 08:10:48 +00:00
const result = importAll(1849).setTimersMonitorCallback(onTimersDelayCallback);
2026-07-20 16:05:17 +00:00
};