-
Notifications
You must be signed in to change notification settings - Fork 4
/
initstats.js
47 lines (44 loc) · 982 Bytes
/
initstats.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const gcStatKeys = [
'gc.Scavenge.count',
'gc.Scavenge.time',
'gc.MarkSweepCompact.count',
'gc.MarkSweepCompact.time',
'gc.IncrementalMarking.count',
'gc.IncrementalMarking.time',
'gc.ProcessWeakCallbacks.count',
'gc.ProcessWeakCallbacks.time',
'gc.time'
];
const statKeys = [
'cpu.usage.process',
'cpu.usage.thread',
'latency.p99',
'latency.mean',
'latency.max',
'latency.min',
'mem.rss',
'mem.heapTotal',
'mem.heapUsed',
'mem.external',
'mem.arrayBuffers',
'mem.heap.large_object_space.used',
'mem.heap.large_object_space.total',
'mem.heap.old_space.used',
'mem.heap.old_space.total',
'mem.heap.new_space.used',
'mem.heap.new_space.total',
'mem.heap.code_space.used',
'mem.heap.code_space.total',
'mem.heap.map_space.used',
'mem.heap.map_space.total',
...gcStatKeys
];
const initStats = statKeys.reduce((rv, key) => {
rv[key] = 0;
return rv;
}, {});
module.exports = {
statKeys,
initStats,
gcStatKeys,
};