Skip to content

Commit b18ac99

Browse files
committed
improvement(monitoring): use stable process.getActiveResourcesInfo() API
1 parent 1f0fa8a commit b18ac99

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apps/sim/lib/monitoring/memory-telemetry.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ export function startMemoryTelemetry(intervalMs = 60_000) {
3434
arrayBuffersMB: Math.round(mem.arrayBuffers / MB),
3535
heapSizeLimitMB: Math.round(heap.heap_size_limit / MB),
3636
nativeContexts: heap.number_of_native_contexts,
37-
activeHandles:
38-
(process as unknown as Record<string, () => unknown[]>)._getActiveHandles?.().length ?? -1,
39-
activeRequests:
40-
(process as unknown as Record<string, () => unknown[]>)._getActiveRequests?.().length ?? -1,
37+
activeResources:
38+
typeof process.getActiveResourcesInfo === 'function'
39+
? process.getActiveResourcesInfo().length
40+
: -1,
4141
uptimeMin: Math.round(process.uptime() / 60),
4242
activeSSEConnections: getActiveSSEConnectionCount(),
4343
sseByRoute: getActiveSSEConnectionsByRoute(),

0 commit comments

Comments
 (0)