Skip to content

Commit

Permalink
Show delivery-count on queue page for quorum queues.
Browse files Browse the repository at this point in the history
To make it more visible that a default is in place.

Also added publisher count as it was easy to do so.
  • Loading branch information
kjnilsson committed Aug 16, 2024
1 parent daecdb0 commit 4746aaf
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 9 deletions.
5 changes: 2 additions & 3 deletions deps/rabbit/src/rabbit_fifo.erl
Original file line number Diff line number Diff line change
Expand Up @@ -850,10 +850,9 @@ overview(#?STATE{consumers = Cons,
#{}
end,
MsgsRet = lqueue:len(Returns),

#{len := _MsgsLen,
num_hi := MsgsHi,
#{num_hi := MsgsHi,
num_lo := MsgsLo} = rabbit_fifo_q:overview(Messages),

Overview = #{type => ?STATE,
config => Conf,
num_consumers => map_size(Cons),
Expand Down
11 changes: 9 additions & 2 deletions deps/rabbit/src/rabbit_quorum_queue.erl
Original file line number Diff line number Diff line change
Expand Up @@ -517,11 +517,12 @@ spawn_notify_decorators(QName, Fun, Args) ->
catch notify_decorators(QName, Fun, Args).

handle_tick(QName,
#{config := #{name := Name},
#{config := #{name := Name} = Cfg,
num_active_consumers := NumConsumers,
num_checked_out := NumCheckedOut,
num_ready_messages := NumReadyMsgs,
num_messages := NumMessages,
num_enqueuers := NumEnqueuers,
enqueue_message_bytes := EnqueueBytes,
checkout_message_bytes := CheckoutBytes,
num_discarded := NumDiscarded,
Expand Down Expand Up @@ -568,6 +569,7 @@ handle_tick(QName,
MsgBytesDiscarded = DiscardBytes + DiscardCheckoutBytes,
MsgBytes = EnqueueBytes + CheckoutBytes + MsgBytesDiscarded,
Infos = [{consumers, NumConsumers},
{publishers, NumEnqueuers},
{consumer_capacity, Util},
{consumer_utilisation, Util},
{messages, NumMessages},
Expand All @@ -582,7 +584,12 @@ handle_tick(QName,
{message_bytes_dlx, MsgBytesDiscarded},
{single_active_consumer_tag, SacTag},
{single_active_consumer_pid, SacPid},
{leader, node()}
{leader, node()},
{queue_type_specific, maps:with([overflow_strategy,
consumer_strategy,
delivery_limit,
expires,
msg_ttl],Cfg)}
| Infos0],
rabbit_core_metrics:queue_stats(QName, Infos),
ok = repair_leader_record(Q, Self),
Expand Down
3 changes: 3 additions & 0 deletions deps/rabbitmq_management/priv/www/js/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ var HELP = {
'queue-dead-lettered':
'Applies to messages dead-lettered with dead-letter-strategy <code>at-least-once</code>.',

'queue-delivery-limit':
'The number of times a message can be returned to this queue before it is dead-lettered (if configured) or dropped.',

'queue-message-body-bytes':
'<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>',

Expand Down
22 changes: 18 additions & 4 deletions deps/rabbitmq_management/priv/www/js/tmpl/queue.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,29 @@
<td><%= fmt_string(queue.consumer_details.length) %></td>
</tr>
<% } %>
<% if (!is_stream(queue)) { %>
<% if (is_classic(queue)) { %>
<tr>
<th>Consumer capacity <span class="help" id="queue-consumer-capacity"></th>
<td><%= fmt_percent(queue.consumer_capacity) %></td>
</tr>
<% } %>
<% if(queue.hasOwnProperty('publishers')) { %>
<tr>
<th>Publishers</th>
<td><%= fmt_string(queue.publishers) %></td>
</tr>
<% } %>
<% if (is_quorum(queue)) { %>
<tr>
<th>Open files</th>
<td><%= fmt_table_short(queue.open_files) %></td>
</tr>
<% if (queue.hasOwnProperty('queue_type_specific')) { %>
<tr>
<th>Delivery limit <span class="help" id="queue-delivery-limit"></th>
<td><%= fmt_string(queue.queue_type_specific.delivery_limit) %></td>
</tr>
<% } %>
<% } %>
<% if (is_stream(queue)) { %>
<tr>
Expand Down Expand Up @@ -187,20 +199,22 @@
<td class="r">
<%= fmt_bytes(queue.message_bytes_unacknowledged) %>
</td>
<td class="r">
<%= fmt_bytes(queue.message_bytes_ram) %>
</td>
<% } %>
<% if (is_quorum(queue)) { %>
<td class="r">
</td>
<td class="r">
</td>
<td class="r">
</td>
<td class="r">
<%= fmt_bytes(queue.message_bytes_dlx) %>
</td>
<% } %>
<% if (is_classic(queue)) { %>
<td class="r">
<%= fmt_bytes(queue.message_bytes_ram) %>
</td>
<td class="r">
<%= fmt_bytes(queue.message_bytes_persistent) %>
</td>
Expand Down

0 comments on commit 4746aaf

Please sign in to comment.