Skip to content

Commit b993925

Browse files
kjnilssonmergify[bot]
authored andcommitted
Show delivery-count on queue page for quorum queues.
To make it more visible that a default is in place. Also added publisher count as it was easy to do so. (cherry picked from commit 3a386f4)
1 parent 63d0c10 commit b993925

File tree

4 files changed

+34
-9
lines changed

4 files changed

+34
-9
lines changed

deps/rabbit/src/rabbit_fifo.erl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -850,10 +850,9 @@ overview(#?STATE{consumers = Cons,
850850
#{}
851851
end,
852852
MsgsRet = lqueue:len(Returns),
853-
854-
#{len := _MsgsLen,
855-
num_hi := MsgsHi,
853+
#{num_hi := MsgsHi,
856854
num_lo := MsgsLo} = rabbit_fifo_q:overview(Messages),
855+
857856
Overview = #{type => ?STATE,
858857
config => Conf,
859858
num_consumers => map_size(Cons),

deps/rabbit/src/rabbit_quorum_queue.erl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,11 +517,12 @@ spawn_notify_decorators(QName, Fun, Args) ->
517517
catch notify_decorators(QName, Fun, Args).
518518

519519
handle_tick(QName,
520-
#{config := #{name := Name},
520+
#{config := #{name := Name} = Cfg,
521521
num_active_consumers := NumConsumers,
522522
num_checked_out := NumCheckedOut,
523523
num_ready_messages := NumReadyMsgs,
524524
num_messages := NumMessages,
525+
num_enqueuers := NumEnqueuers,
525526
enqueue_message_bytes := EnqueueBytes,
526527
checkout_message_bytes := CheckoutBytes,
527528
num_discarded := NumDiscarded,
@@ -568,6 +569,7 @@ handle_tick(QName,
568569
MsgBytesDiscarded = DiscardBytes + DiscardCheckoutBytes,
569570
MsgBytes = EnqueueBytes + CheckoutBytes + MsgBytesDiscarded,
570571
Infos = [{consumers, NumConsumers},
572+
{publishers, NumEnqueuers},
571573
{consumer_capacity, Util},
572574
{consumer_utilisation, Util},
573575
{messages, NumMessages},
@@ -582,7 +584,14 @@ handle_tick(QName,
582584
{message_bytes_dlx, MsgBytesDiscarded},
583585
{single_active_consumer_tag, SacTag},
584586
{single_active_consumer_pid, SacPid},
585-
{leader, node()}
587+
{leader, node()},
588+
{delivery_limit, case maps:get(delivery_limit, Cfg,
589+
undefined) of
590+
undefined ->
591+
unlimited;
592+
Limit ->
593+
Limit
594+
end}
586595
| Infos0],
587596
rabbit_core_metrics:queue_stats(QName, Infos),
588597
ok = repair_leader_record(Q, Self),

deps/rabbitmq_management/priv/www/js/global.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ var HELP = {
256256
'queue-dead-lettered':
257257
'Applies to messages dead-lettered with dead-letter-strategy <code>at-least-once</code>.',
258258

259+
'queue-delivery-limit':
260+
'The number of times a message can be returned to this queue before it is dead-lettered (if configured) or dropped.',
261+
259262
'queue-message-body-bytes':
260263
'<p>The sum total of the sizes of the message bodies in this queue. This only counts message bodies; it does not include message properties (including headers) or metadata used by the queue.</p><p>Note that "in memory" and "persistent" are not mutually exclusive; persistent messages can be in memory as well as on disc, and transient messages can be paged out if memory is tight. Non-durable queues will consider all messages to be transient.</p><p>If a message is routed to multiple queues on publication, its body will be stored only once (in memory and on disk) and shared between queues. The value shown here does not take account of this effect.</p>',
261264

deps/rabbitmq_management/priv/www/js/tmpl/queue.ejs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,29 @@
9292
<td><%= fmt_string(queue.consumer_details.length) %></td>
9393
</tr>
9494
<% } %>
95-
<% if (!is_stream(queue)) { %>
95+
<% if (is_classic(queue)) { %>
9696
<tr>
9797
<th>Consumer capacity <span class="help" id="queue-consumer-capacity"></th>
9898
<td><%= fmt_percent(queue.consumer_capacity) %></td>
9999
</tr>
100100
<% } %>
101+
<% if(queue.hasOwnProperty('publishers')) { %>
102+
<tr>
103+
<th>Publishers</th>
104+
<td><%= fmt_string(queue.publishers) %></td>
105+
</tr>
106+
<% } %>
101107
<% if (is_quorum(queue)) { %>
102108
<tr>
103109
<th>Open files</th>
104110
<td><%= fmt_table_short(queue.open_files) %></td>
105111
</tr>
112+
<% if (queue.hasOwnProperty('delivery_limit')) { %>
113+
<tr>
114+
<th>Delivery limit <span class="help" id="queue-delivery-limit"></th>
115+
<td><%= fmt_string(queue.delivery_limit) %></td>
116+
</tr>
117+
<% } %>
106118
<% } %>
107119
<% if (is_stream(queue)) { %>
108120
<tr>
@@ -187,20 +199,22 @@
187199
<td class="r">
188200
<%= fmt_bytes(queue.message_bytes_unacknowledged) %>
189201
</td>
190-
<td class="r">
191-
<%= fmt_bytes(queue.message_bytes_ram) %>
192-
</td>
193202
<% } %>
194203
<% if (is_quorum(queue)) { %>
195204
<td class="r">
196205
</td>
197206
<td class="r">
198207
</td>
208+
<td class="r">
209+
</td>
199210
<td class="r">
200211
<%= fmt_bytes(queue.message_bytes_dlx) %>
201212
</td>
202213
<% } %>
203214
<% if (is_classic(queue)) { %>
215+
<td class="r">
216+
<%= fmt_bytes(queue.message_bytes_ram) %>
217+
</td>
204218
<td class="r">
205219
<%= fmt_bytes(queue.message_bytes_persistent) %>
206220
</td>

0 commit comments

Comments
 (0)