File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,25 @@ The current allocated heap size in bytes.
129
129
130
130
The currently used heap size in bytes.
131
131
132
+ [float]
133
+ [[metric-nodejs.memory.external.bytes]]
134
+ === `nodejs.memory.external.bytes`
135
+
136
+ * *Type:* Long
137
+ * *Format:* Bytes
138
+
139
+ Memory usage of C++ objects bound to JavaScript objects managed by V8.
140
+
141
+ [float]
142
+ [[metric-nodejs.memory.arrayBuffers.bytes]]
143
+ === `nodejs.memory.arrayBuffers.bytes`
144
+
145
+ * *Type:* Long
146
+ * *Format:* Bytes
147
+
148
+ Memory allocated for ArrayBuffers and SharedArrayBuffers, including all Node.js Buffers.
149
+ This is also included in the `nodejs.memory.external.bytes` value.
150
+
132
151
[float]
133
152
[[metrics-transaction.duration.sum]]
134
153
=== `transaction.duration.sum`
Original file line number Diff line number Diff line change @@ -19,7 +19,9 @@ class RuntimeCollector {
19
19
'nodejs.requests.active' : 0 ,
20
20
'nodejs.eventloop.delay.ns' : 0 ,
21
21
'nodejs.memory.heap.allocated.bytes' : 0 ,
22
- 'nodejs.memory.heap.used.bytes' : 0
22
+ 'nodejs.memory.heap.used.bytes' : 0 ,
23
+ 'nodejs.memory.external.bytes' : 0 ,
24
+ 'nodejs.memory.arrayBuffers.bytes' : 0
23
25
}
24
26
25
27
const monitor = eventLoopMonitor ( {
@@ -46,6 +48,9 @@ class RuntimeCollector {
46
48
this . stats [ 'nodejs.memory.heap.allocated.bytes' ] = memoryUsage . heapTotal
47
49
this . stats [ 'nodejs.memory.heap.used.bytes' ] = memoryUsage . heapUsed
48
50
51
+ this . stats [ 'nodejs.memory.external.bytes' ] = memoryUsage . external
52
+ this . stats [ 'nodejs.memory.arrayBuffers.bytes' ] = memoryUsage . arrayBuffers || 0 // Only available in NodeJS +13.0
53
+
49
54
if ( cb ) process . nextTick ( cb )
50
55
}
51
56
}
Original file line number Diff line number Diff line change @@ -117,6 +117,12 @@ test('reports expected metrics', function (t) {
117
117
'nodejs.memory.heap.used.bytes' : ( value ) => {
118
118
t . ok ( value >= 0 , 'is positive' )
119
119
} ,
120
+ 'nodejs.memory.external.bytes' : ( value ) => {
121
+ t . ok ( value >= 0 , 'is positive' )
122
+ } ,
123
+ 'nodejs.memory.arrayBuffers.bytes' : ( value ) => {
124
+ t . ok ( value >= 0 , 'is positive' )
125
+ } ,
120
126
'ws.connections' : ( value ) => {
121
127
t . equal ( value , 23 )
122
128
}
You can’t perform that action at this time.
0 commit comments