/
Runtime.ts
83 lines (81 loc) · 1.85 KB
/
Runtime.ts
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*eslint no-template-curly-in-string: "off"*/
import { Metric, UnitEnum } from 'model/Metric';
import { uuid } from 'uuidv4';
function metric(title: string, ql: string, span: number = 24, unit: UnitEnum = UnitEnum.None): Metric {
return {
span,
id: uuid(),
chart: { unit, title, target: { ql, db: '_internal' } },
}
}
export const RuntimeStorageBoard = [
// Row
[
metric(
'Sys (number of heap bytes obtained from system)',
'select gauge from go_memstats_heap_sys_bytes',
8,
UnitEnum.Bytes,
),
metric(
'Frees (number of frees)',
'select counter from go_memstats_frees_total',
8,
UnitEnum.Bytes,
),
metric(
'Total Alloc (bytes allocated even if freed)',
'select counter from go_memstats_alloc_bytes_total',
8,
UnitEnum.Bytes,
),
],
[
metric(
'HeapAlloc (bytes allocated and not yet freed)',
'select gauge from go_memstats_heap_alloc_bytes',
8,
UnitEnum.Bytes,
),
metric(
'Heap Objects (total number of allocated objects)',
'select gauge from go_memstats_heap_objects',
8,
UnitEnum.None,
),
metric(
'HeapInused (bytes in non-idle span)',
'select gauge from go_memstats_heap_inuse_bytes',
8,
UnitEnum.Bytes,
),
],
[
metric(
'Number of goroutines',
'select gauge from go_goroutines',
8,
UnitEnum.None,
),
metric(
'GC invocation duration',
'select sum(summary) from go_gc_duration_seconds',
8,
UnitEnum.Seconds,
),
metric(
'GC invocation count',
'select count(summary) from go_gc_duration_seconds',
8,
UnitEnum.None,
),
],
[
metric(
'Lookups(number of pointer lookups)',
'select counter from go_memstats_lookups_total',
8,
UnitEnum.None,
),
],
]