File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 11'use strict'
22
3- const v8 = require ( 'v8' )
4-
53const eventLoopMonitor = require ( 'monitor-event-loop-delay' )
64
75const activeHandles = typeof process . _getActiveHandles === 'function'
@@ -43,10 +41,10 @@ class RuntimeCollector {
4341 this . stats [ 'nodejs.eventloop.delay.avg.ms' ] = loopDelay
4442 this . loopMonitor . reset ( )
4543
46- // Heap
47- const heap = v8 . getHeapStatistics ( )
48- this . stats [ 'nodejs.memory.heap.allocated.bytes' ] = heap . total_heap_size
49- this . stats [ 'nodejs.memory.heap.used.bytes' ] = heap . used_heap_size
44+ // Memory / Heap
45+ const memoryUsage = process . memoryUsage ( )
46+ this . stats [ 'nodejs.memory.heap.allocated.bytes' ] = memoryUsage . heapTotal
47+ this . stats [ 'nodejs.memory.heap.used.bytes' ] = memoryUsage . heapUsed
5048
5149 if ( cb ) process . nextTick ( cb )
5250 }
You can’t perform that action at this time.
0 commit comments