summaryrefslogtreecommitdiff
path: root/deps/rabbitmq_top/priv/www/js/tmpl/processes.ejs
blob: e06f58d68e4868280294e2005f74e99c735d2792 (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
<h1>Top Processes: <b><%= top.node %></b></h1>

<p>
  Node:
  <select id="top-node">
  <% for (var i = 0; i < nodes.length; i++) { %>
     <option name="#/top/<%= fmt_string(nodes[i].name) %>"<% if (nodes[i].name == top.node) { %>selected="selected"<% } %>><%= nodes[i].name %></option>
  <% } %>
  </select>

  Rows:
  <select id="row-count">
  <%
    var row_counts = [20, 50, 100, 150];
    for (var i = 0; i < row_counts.length; i++) {
  %>
    <option name="<%= row_counts[i] %>"
        <% if (row_counts[i] == top.row_count) { %>selected="selected"<% } %>>
    <%= row_counts[i] %></option>
  <% } %>
  </select>
</p>

<table class="list updatable">
 <thead>
  <tr>
    <th><%= fmt_sort_desc_by_default('Process', 'pid') %></th>
    <th>Description</th>
    <th>Type</th>
    <th><%= fmt_sort_desc_by_default('Memory', 'memory') %></th>
    <th><%= fmt_sort_desc_by_default('Reductions / sec', 'reduction_delta') %></th>
    <th><%= fmt_sort_desc_by_default('Erlang mailbox', 'message_queue_len') %></th>
    <th><%= fmt_sort_desc_by_default('gen_server2 buffer', 'buffer_len') %><span class="help" id="gen-server2-buffer"></span></th>
    <th>Status</th>
  </tr>
 </thead>
 <tbody>
<%
 for (var i = 0; i < top.processes.length; i++) {
    var process = top.processes[i];
%>
  <tr<%= alt_rows(i)%>>
    <td><%= link_pid(process.pid) %></td>
    <td><%= fmt_process_name(process) %></td>
    <td><%= fmt_remove_rabbit_prefix(process.name.type) %></td>
    <td><%= fmt_bytes(process.memory * 1.0) %></td>
    <td><%= fmt_reduction_delta(process.reduction_delta) %></td>
    <td><%= process.message_queue_len %></td>
    <td><%= process.buffer_len %></td>
    <td><%= process.status %></td>
  </tr>
<% } %>
 </tbody>
</table>