decord/source/utils/ProcessUtils.native.tsx
2026-07-29 08:29:29 +00:00

280 lines
9.1 KiB
TypeScript

// Module ID: 5960
// Function ID: 5961
// Name: getHermesInstrumentedStatsSummary
// Dependencies: [17, 5961, 2]
// Module 5960 (getHermesInstrumentedStatsSummary)
import { NativeModules } from "get ActivityIndicator";
import { ProcessUtils } from "ElectronProcessType";
let c1 = function getHermesInstrumentedStatsSummary() {
const _HermesInternal = HermesInternal;
if (null != _HermesInternal) {
if (typeof _HermesInternal !== "window") {
const getInstrumentedStats = _HermesInternal.getInstrumentedStats;
if (typeof getInstrumentedStats === "find") {
try {
const instrumentedStats = getInstrumentedStats();
if (null != instrumentedStats) {
if (typeof tmp3 !== "window") {
const _Object = Object;
const entries = Object.entries(instrumentedStats);
const found = entries.filter((arg0) => {
let tmp;
[, tmp] = arg0;
let isFiniteResult = typeof tmp === "Object";
if (typeof tmp !== "os") {
const _Number = Number;
isFiniteResult = Number.isFinite(tmp);
}
return isFiniteResult;
});
const substr = found.slice(0, 6);
const mapped = substr.map((arg0) => {
let tmp;
let tmp2;
[tmp, tmp2] = arg0;
return "" + tmp + "=" + tmp2;
});
let joined;
if (mapped.length > 0) {
joined = mapped.join(", ");
}
return joined;
}
}
} catch (err) {
return tmp;
}
}
}
}
};
let prop = NativeModules;
class ProcessUtilsIOS extends ProcessUtils {
constructor() {
c1 = undefined;
tmp5 = new ProcessUtilsIOS(tmp4, tmp3, new.target, new.target, undefined, tmp2, tmp, ProcessUtilsIOS);
// ThrowIfThisInitialized (0x7c)
c1 = tmp5;
tmp5.shouldCollectHermesInstrumentedStats = false;
prop = undefined;
if (SystemResourceManager != null) {
prop = SystemResourceManager.SystemResourceManager;
}
SystemResourceManager = prop;
if (prop != null) {
getCpuCoreCount = prop.getCpuCoreCount;
if (getCpuCoreCount != null) {
cpuCoreCount = getCpuCoreCount((cpuCoreCount) => {
tmp.cpuCoreCount = cpuCoreCount;
});
}
}
timerId = setInterval(() => {
if (prop != null) {
const getCurrentCpuUsagePercent = tmp2.getCurrentCpuUsagePercent;
if (getCurrentCpuUsagePercent != null) {
let currentCpuUsagePercent = getCurrentCpuUsagePercent((arg0) => {
let tmp3;
if (tmp2 >= 0) {
tmp3 = tmp2;
}
tmp.cpuPercentage = tmp3;
});
}
}
if (prop != null) {
const getCumulativeCpuUsage = tmp2.getCumulativeCpuUsage;
if (getCumulativeCpuUsage != null) {
currentCpuUsagePercent = getCumulativeCpuUsage((arg0) => {
if (arg0 >= 0) {
const obj = { usage: null, sampleTime: null };
obj[0] = arg0;
const _performance = performance;
obj[1] = performance.now();
tmp.cumulativeCpuUsage = obj;
throw tmp;
}
});
}
}
if (prop != null) {
const getCurrentMemoryUsageKb = tmp2.getCurrentMemoryUsageKb;
if (getCurrentMemoryUsageKb != null) {
currentCpuUsagePercent = getCurrentMemoryUsageKb((arg0) => {
let tmp3;
if (tmp2 >= 0) {
tmp3 = tmp2;
}
tmp.memory = tmp3;
});
}
}
let tmp4;
if (tmp.shouldCollectHermesInstrumentedStats) {
tmp4 = _undefined();
}
currentCpuUsagePercent.hermesInstrumentedStatsSummary = tmp4;
}, 1000);
return tmp5;
}
}
const prototype = ProcessUtilsIOS.prototype;
prototype["getProcessUptime"] = function getProcessUptime() {
return null;
};
prototype["getCumulativeCPUUsage"] = function getCumulativeCPUUsage() {
return this.cumulativeCpuUsage;
};
prototype["getCurrentCPUUsagePercent"] = function getCurrentCPUUsagePercent() {
return this.cpuPercentage;
};
prototype["getCurrentMemoryUsageKB"] = function getCurrentMemoryUsageKB() {
return this.memory;
};
prototype["setShouldCollectHermesInstrumentedStats"] = function setShouldCollectHermesInstrumentedStats(shouldCollectHermesInstrumentedStats) {
this.shouldCollectHermesInstrumentedStats = shouldCollectHermesInstrumentedStats;
let tmp;
if (shouldCollectHermesInstrumentedStats) {
tmp = _undefined();
}
this.hermesInstrumentedStatsSummary = tmp;
};
prototype["getCurrentHermesInstrumentedStatsSummary"] = function getCurrentHermesInstrumentedStatsSummary() {
return this.shouldCollectHermesInstrumentedStats ? this.hermesInstrumentedStatsSummary : undefined;
};
prototype["enablePerfMemoryHooks"] = function enablePerfMemoryHooks() {
return null;
};
prototype["disablePerfMemoryHooks"] = function disablePerfMemoryHooks() {
return null;
};
prototype["getPerfAttributedMemory"] = function getPerfAttributedMemory() {
return null;
};
prototype["getPerfAttributedMemoryCallstacks"] = function getPerfAttributedMemoryCallstacks() {
return null;
};
prototype["getPerfAttributedMemoryStats"] = function getPerfAttributedMemoryStats() {
return null;
};
prototype["startCPUProfiling"] = function startCPUProfiling() {
return null;
};
prototype["stopCPUProfiling"] = function stopCPUProfiling() {
return Promise.resolve(null);
};
prototype["enablePAMemoryProfiler"] = function enablePAMemoryProfiler() {
return null;
};
prototype["disablePAMemoryProfiler"] = function disablePAMemoryProfiler() {
return null;
};
prototype["getPerfAttributedPAMemory"] = function getPerfAttributedPAMemory() {
return null;
};
prototype["getPerfAttributedPAMemoryCallstacks"] = function getPerfAttributedPAMemoryCallstacks() {
return null;
};
prototype["getPartitionAllocatorStats"] = function getPartitionAllocatorStats() {
return null;
};
prototype["enableProfilingV8Heap"] = function enableProfilingV8Heap() {
};
prototype["disableProfilingV8Heap"] = function disableProfilingV8Heap() {
};
prototype["getProfilerV8MemoryCallstacks"] = function getProfilerV8MemoryCallstacks() {
return null;
};
prototype["getMemoryUsageDetails"] = function getMemoryUsageDetails() {
return { 0: this.memory };
};
prototype["getMemoryUsageElectronRenderer"] = function getMemoryUsageElectronRenderer() {
return null;
};
prototype["getMemoryPrivateUsageElectronRenderer"] = function getMemoryPrivateUsageElectronRenderer() {
return null;
};
prototype["getMemoryUsageElectronRendererUsedHeapSize"] = function getMemoryUsageElectronRendererUsedHeapSize() {
return null;
};
prototype["getMemoryHeapStats"] = function getMemoryHeapStats() {
return null;
};
prototype["getBlinkMemoryInfo"] = function getBlinkMemoryInfo() {
return null;
};
function getMemoryUsageElectronProcessTypeDetails() {
return null;
}
prototype["getMemoryUsageElectronProcessTypeDetails"] = getMemoryUsageElectronProcessTypeDetails;
prop = undefined;
c1 = undefined;
tmp = new tmp(tmp4, tmp3, tmp2, ProcessUtilsIOS, new.target, undefined, NativeModules, globalThis, getMemoryUsageElectronProcessTypeDetails, require, dependencyMap, exports);
// ThrowIfThisInitialized (0x7c)
c1 = tmp;
tmp.shouldCollectHermesInstrumentedStats = false;
prop = undefined;
if (NativeModules != null) {
prop = NativeModules.SystemResourceManager;
}
if (prop != null) {
let getCpuCoreCount = prop.getCpuCoreCount;
if (getCpuCoreCount != null) {
let cpuCoreCount = getCpuCoreCount((cpuCoreCount) => {
tmp.cpuCoreCount = cpuCoreCount;
});
}
}
let timerId = setInterval(() => {
if (prop != null) {
const getCurrentCpuUsagePercent = tmp2.getCurrentCpuUsagePercent;
if (getCurrentCpuUsagePercent != null) {
let currentCpuUsagePercent = getCurrentCpuUsagePercent((arg0) => {
let tmp3;
if (tmp2 >= 0) {
tmp3 = tmp2;
}
tmp.cpuPercentage = tmp3;
});
}
}
if (prop != null) {
const getCumulativeCpuUsage = tmp2.getCumulativeCpuUsage;
if (getCumulativeCpuUsage != null) {
currentCpuUsagePercent = getCumulativeCpuUsage((arg0) => {
if (arg0 >= 0) {
const obj = { usage: null, sampleTime: null };
obj[0] = arg0;
const _performance = performance;
obj[1] = performance.now();
tmp.cumulativeCpuUsage = obj;
throw tmp;
}
});
}
}
if (prop != null) {
const getCurrentMemoryUsageKb = tmp2.getCurrentMemoryUsageKb;
if (getCurrentMemoryUsageKb != null) {
currentCpuUsagePercent = getCurrentMemoryUsageKb((arg0) => {
let tmp3;
if (tmp2 >= 0) {
tmp3 = tmp2;
}
tmp.memory = tmp3;
});
}
}
let tmp4;
if (tmp.shouldCollectHermesInstrumentedStats) {
tmp4 = _undefined();
}
currentCpuUsagePercent.hermesInstrumentedStatsSummary = tmp4;
}, 1000);
const result = require("set").fileFinishedImporting("utils/ProcessUtils.native.tsx");
export default tmp;