Skip to content

Commit eb69cd7

Browse files
committed
QQ: display per priority message counts in mgmt UI.
This could do with some improvement but has some utility for now.
1 parent 67a3b13 commit eb69cd7

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

deps/rabbit/src/rabbit_fifo.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,8 @@ overview(#?STATE{consumers = Cons,
948948
#{
949949
% num_hi := MsgsHi,
950950
% num_no := MsgsNo
951+
num_active_priorities := NumActivePriorities,
952+
detail := Detail
951953
} = rabbit_fifo_pq:overview(Messages),
952954

953955
Overview = #{type => ?STATE,
@@ -964,7 +966,9 @@ overview(#?STATE{consumers = Cons,
964966
enqueue_message_bytes => EnqueueBytes,
965967
checkout_message_bytes => CheckoutBytes,
966968
discarded_bytes => DiscardedBytes,
967-
smallest_raft_index => smallest_raft_index(State)
969+
smallest_raft_index => smallest_raft_index(State),
970+
num_active_priorities => NumActivePriorities,
971+
messages_by_priority => Detail
968972
},
969973
DlxOverview = dlx_overview(DlxState),
970974
maps:merge(maps:merge(Overview, DlxOverview), SacOverview).

deps/rabbit/src/rabbit_quorum_queue.erl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,10 @@ handle_tick(QName,
620620
[{messages_ready_normal, V} | Acc];
621621
(num_ready_messages_return, V, Acc) ->
622622
[{messages_ready_returned, V} | Acc];
623+
(messages_by_priority, V, Acc) ->
624+
[{messages_by_priority, V} | Acc];
625+
(num_active_priorities, V, Acc) ->
626+
[{messages_active_priorities, V} | Acc];
623627
(_, _, Acc) ->
624628
Acc
625629
end, info(Q, Keys), Overview),

deps/rabbitmq_management/priv/www/js/tmpl/quorum-queue-stats.ejs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
<th>Open files</th>
2626
<td><%= fmt_table_short(queue.open_files) %></td>
2727
</tr>
28+
<% if (queue.hasOwnProperty('messages_by_priority')) { %>
29+
<tr>
30+
<th>Messages by priority</th>
31+
<td><%= fmt_table_short(queue.messages_by_priority) %></td>
32+
</tr>
33+
<% } %>
2834
<% if (queue.hasOwnProperty('delivery_limit')) { %>
2935
<tr>
3036
<th>Delivery limit <span class="help" id="queue-delivery-limit"></th>
@@ -40,8 +46,7 @@
4046
<th class="horizontal">Total</th>
4147
<th class="horizontal">Ready</th>
4248
<th class="horizontal">Unacked</th>
43-
<th class="horizontal">High priority</th>
44-
<th class="horizontal">Normal priority</th>
49+
<th class="horizontal">Active priorities</th>
4550
<th class="horizontal">Returned</th>
4651
<th class="horizontal">Dead-lettered
4752
<span class="help" id="queue-dead-lettered"></span>
@@ -62,10 +67,7 @@
6267
<%= fmt_num_thousands(queue.messages_unacknowledged) %>
6368
</td>
6469
<td class="r">
65-
<%= fmt_num_thousands(queue.messages_ready_high) %>
66-
</td>
67-
<td class="r">
68-
<%= fmt_num_thousands(queue.messages_ready_normal) %>
70+
<%= fmt_num_thousands(queue.messages_active_priorities) %>
6971
</td>
7072
<td class="r">
7173
<%= fmt_num_thousands(queue.messages_ready_returned) %>
@@ -105,4 +107,4 @@
105107
</th>
106108
<td class="r"><%= fmt_bytes(queue.memory) %></td>
107109
</tr>
108-
</table>
110+
</table>

0 commit comments

Comments
 (0)