-
Notifications
You must be signed in to change notification settings - Fork 3.9k
/
memory.ejs
99 lines (93 loc) · 4.72 KB
/
memory.ejs
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<%
if (memory == "not_available") {
%>
<p class="warning">
Memory statistics not available.
</p>
<% } else { %>
<%
var sections = {'queue_procs' : ['classic', 'Classic queues'],
'quorum_queue_procs' : ['quorum', 'Quorum queues'],
'quorum_queue_dlx_procs' : ['quorum', 'Dead letter workers'],
'stream_queue_procs' : ['stream', 'Stream queues'],
'stream_queue_replica_reader_procs' : ['stream', 'Stream queues (replica reader)'],
'stream_queue_coordinator_procs' : ['stream', 'Stream queues (coordinator)'],
'binary' : ['binary', 'Binaries'],
'connection_readers' : ['conn', 'Connection readers'],
'connection_writers' : ['conn', 'Connection writers'],
'connection_channels' : ['conn', 'Connection channels'],
'connection_other' : ['conn', 'Connections (other)'],
'mnesia' : ['table', 'Mnesia'],
'msg_index' : ['table', 'Message store index'],
'mgmt_db' : ['table', 'Management database'],
'quorum_ets' : ['table', 'Quorum queue ETS tables'],
'other_ets' : ['table', 'Other ETS tables'],
'plugins' : ['proc', 'Plugins'],
'other_proc' : ['proc', 'Other process memory'],
'code' : ['system', 'Code'],
'atom' : ['system', 'Atoms'],
'other_system' : ['system', 'Other system'],
'allocated_unused' : ['unused', 'Allocated unused'],
'reserved_unallocated': ['unused', 'Unallocated reserved by the OS']};
%>
<%= format('memory-bar', {sections: sections, memory: memory, total_out: []}) %>
<span class="clear"> </span>
<div class="box">
<%
var key = [[{name: 'Classic Queues', colour: 'classic',
keys: [['queue_procs', 'queues']]},
{name: 'Quorum Queues', colour: 'quorum',
keys: [['quorum_queue_procs','quorum'],
['quorum_queue_dlx_procs', 'dead letter workers']]},
{name: 'Streams', colour: 'stream',
keys: [['stream_queue_procs', 'stream'],
['stream_queue_replica_reader_procs', 'stream replica reader'],
['stream_queue_coordinator_procs', 'stream coordinator']]},
{name: 'Binaries', colour: 'binary',
keys: [['binary', '']]}],
[{name: 'Connections', colour: 'conn',
keys: [['connection_readers', 'readers'],
['connection_writers', 'writers'],
['connection_channels', 'channels'],
['connection_other', 'other']]}],
[{name: 'Tables', colour: 'table',
keys: [['mnesia', 'internal database tables'],
['msg_index', 'message store index'],
['mgmt_db', 'management database'],
['quorum_ets', 'quorum queue tables'],
['other_ets', 'other']]}],
[{name: 'Processes', colour: 'proc',
keys: [['plugins', 'plugins'],
['metadata_store', 'metadata store'],
['other_proc', 'other']]},
{name: 'System', colour: 'system',
keys: [['code', 'code'],
['atom', 'atoms'],
['other_system', 'other']
]}],
[{name: 'Preallocated memory', colour: 'unused',
keys: [['allocated_unused', 'preallocated by runtime, unused'],
['reserved_unallocated', 'unallocated, reserved by the OS']]}]];
%>
<%= format('memory-table', {key: key, memory: memory}) %>
</div>
<div class="memory-info">
Last updated: <b><%= fmt_date(new Date()) %></b>.<br/>
Memory calculation strategy: <b><%= memory.strategy %></b>. <span class="help" id="memory-calculation-strategy-breakdown"></span><br/><br/>
Amount of memory used vs. allocated during last update: <span class="help" id="memory-use"></span><br/>
<table class="facts">
<tr>
<th>Runtime Used</th>
<td><%= fmt_bytes(memory.total.erlang) %></td>
</tr>
<tr>
<th>Runtime Allocated</th>
<td><%= fmt_bytes(memory.total.allocated) %></td>
</tr>
<tr>
<th>Resident Set Size (RSS) reported by the OS</th>
<td><%= fmt_bytes(memory.total.rss) %></td>
</tr>
</table>
</div>
<% } %>