Skip to content

Commit 9978212

Browse files
committed
Highlight busy incoming links
Visualise busy links from publisher to RabbitMQ. If the link credit reaches 0, we set a yellow background colour in the cell. Note that these credit values can change many times per second while the management UI refreshes only every few seconds. However, it may still give a user an idea of what links are currently busy. We use yellow since that's consistent with the `flow` state in AMQP 0.9.1, which is also set to yellow. We do not want want to highlight **outgoing** links with credit 0 as that might be a paused consumer, and therefore not a busy link. We also use yellow background color if incoming-window is 0 (in case of a cluster wider memory or disk alarm) or if remote-incoming-window is 0 as consumers should try to keep their incoming-window open and instead use link credit if they want to pause consumption. Additionaly we set a grey background colour for the `/management` address just to highlight them slightly since these are "special" link pairs.
1 parent 3ff90de commit 9978212

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

deps/rabbitmq_management/priv/www/css/main.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,3 +420,11 @@ input.toggle:checked + label.toggle:after {
420420
left: calc(100% - 2px);
421421
transform: translateX(-100%);
422422
}
423+
424+
.grey-background {
425+
background-color: #f0f0f0;
426+
}
427+
428+
.yellow-background {
429+
background-color: #ffff7b;
430+
}

deps/rabbitmq_management/priv/www/js/tmpl/sessions-list.ejs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
<%
2+
function getAddressClass(address) {
3+
return address === '/management' ? 'grey-background' : '';
4+
}
5+
6+
function getCreditClass(credit) {
7+
return credit === 0 || credit === '0' ? 'yellow-background' : '';
8+
}
9+
%>
10+
111
<% if (sessions.length > 0) { %>
212
<table class="list" id="sessions">
313
<thead>
@@ -22,9 +32,9 @@
2232
<td class="c"><%= fmt_string(session.channel_number) %></td>
2333
<td class="c"><%= fmt_string(session.handle_max) %></td>
2434
<td class="c"><%= fmt_string(session.next_incoming_id) %></td>
25-
<td class="c"><%= fmt_string(session.incoming_window) %></td>
35+
<td class="c <%= getCreditClass(session.incoming_window) %>"><%= fmt_string(session.incoming_window) %></td>
2636
<td class="c"><%= fmt_string(session.next_outgoing_id) %></td>
27-
<td class="c"><%= fmt_string(session.remote_incoming_window) %></td>
37+
<td class="c <%= getCreditClass(session.remote_incoming_window) %>"><%= fmt_string(session.remote_incoming_window) %></td>
2838
<td class="c"><%= fmt_string(session.remote_outgoing_window) %></td>
2939
<td class="c"><%= fmt_string(session.outgoing_unsettled_deliveries) %></td>
3040
</tr>
@@ -53,11 +63,11 @@
5363
<tr class="link">
5464
<td class="c"><%= fmt_string(in_link.handle) %></td>
5565
<td class="c"><%= fmt_string(in_link.link_name) %></td>
56-
<td class="c"><%= fmt_string(in_link.target_address) %></td>
66+
<td class="c <%= getAddressClass(in_link.target_address) %>"><%= fmt_string(in_link.target_address) %></td>
5767
<td class="c"><%= fmt_string(in_link.snd_settle_mode) %></td>
5868
<td class="c"><%= fmt_string(in_link.max_message_size) %></td>
5969
<td class="c"><%= fmt_string(in_link.delivery_count) %></td>
60-
<td class="c"><%= fmt_string(in_link.credit) %></td>
70+
<td class="c <%= getCreditClass(in_link.credit) %>"><%= fmt_string(in_link.credit) %></td>
6171
<td class="c"><%= fmt_string(in_link.unconfirmed_messages) %></td>
6272
</tr>
6373
<% } %>
@@ -91,7 +101,7 @@
91101
<tr class="link">
92102
<td class="c"><%= fmt_string(out_link.handle) %></td>
93103
<td class="c"><%= fmt_string(out_link.link_name) %></td>
94-
<td class="c"><%= fmt_string(out_link.source_address) %></td>
104+
<td class="c <%= getAddressClass(out_link.source_address) %>"><%= fmt_string(out_link.source_address) %></td>
95105
<td class="c"><%= fmt_string(out_link.queue_name) %></td>
96106
<td class="c"><%= fmt_boolean(out_link.send_settled) %></td>
97107
<td class="c"><%= fmt_string(out_link.max_message_size) %></td>

0 commit comments

Comments
 (0)