summaryrefslogtreecommitdiff
path: root/deps/rabbitmq_management/priv/www/js/tmpl/memory.ejs
blob: 9bb129f446f9456d68005bd0d132a459e5f4d508 (plain)
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
<%
  if (memory == "not_available") {
%>
<p class="warning">
  Memory statistics not available.
</p>
<% } else { %>
<%
  var sections = {'queue_procs'         : ['queue',  'Classic queues (masters)'],
                  'queue_slave_procs'   : ['queue',  'Classic queues (mirrors)'],
                  'quorum_queue_procs'  : ['quorum', 'Quorum queues'],
                  '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">&nbsp;</span>
<div class="box">
<%
var key = [[{name: 'Queues', colour: 'queue',
             keys: [['queue_procs',         'queues'],
                    ['queue_slave_procs',   'mirrors'],
                    ['quorum_queue_procs',  'quorum'],
                    ['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'],
                    ['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>

<% } %>