Skip to content

Commit 0e803de

Browse files
Merge pull request #13634 from rabbitmq/mk-shovel-http-api-metrics
New Shovel management UI metrics
2 parents bb7cd83 + 9efa0d9 commit 0e803de

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

deps/rabbitmq_shovel_management/priv/www/js/shovel.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,19 @@ HELP['shovel-amqp10-auto-delete'] =
148148
<dt><code>After num messages</code></dt>\
149149
<dd>The shovel will delete itself after the given number of messages have been transferred.</dd>\
150150
</dl>';
151+
152+
HELP['shovel-remaining-counter'] =
153+
'When not <code>unlimited</code>: number of messages left to transfer before this shovel will be deleted.';
154+
155+
HELP['shovel-remaining-unacked-counter'] =
156+
'When ack mode is <code>on-confirm</code> and Remaining is not <code>unlimited</code>: number of messages not yet acknowledged at the source.';
157+
158+
HELP['shovel-pending-counter'] =
159+
'When destination connection is blocked or doesn\'t have enough credits: number of messages that were cached.';
160+
161+
HELP['shovel-forwarded-counter'] =
162+
'Number of forwarded messages.';
163+
151164
function remove_params_with(sammy, prefix) {
152165
for (var i in sammy.params) {
153166
if(i.startsWith(prefix)) {

deps/rabbitmq_shovel_management/priv/www/js/tmpl/shovels.ejs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
<th>Virtual Host</th>
1818
<% } %>
1919
<th>State</th>
20+
<th>Remaining <span class="help" id="shovel-remaining-counter"></span></th>
21+
<th>Remaining Unacked <span class="help" id="shovel-remaining-unacked-counter"></span></th>
22+
<th>Pending <span class="help" id="shovel-pending-counter"></span></th>
23+
<th>Forwarded <span class="help" id="shovel-forwarded-counter"></span></th>
2024
<th colspan="3">Source</th>
2125
<th colspan="3">Destination</th>
2226
<th>Last changed</th>
@@ -46,7 +50,11 @@
4650
</td>
4751
<td><%= shovel.timestamp %></td>
4852
<% } else { %>
49-
<td><%= fmt_object_state(shovel) %></td>
53+
<td><%= fmt_object_state(shovel) %></td>
54+
<td><%= fmt_string(shovel.remaining) %></td>
55+
<td><%= fmt_string(shovel.remaining_unacked) %></td>
56+
<td><%= fmt_string(shovel.pending) %></td>
57+
<td><%= fmt_string(shovel.forwarded) %></td>
5058
<td><%= fmt_string(shovel.src_protocol) %></td>
5159
<td><%= shovel.src_uri == undefined ? fmt_string(shovel.src_uri) : fmt_string(fmt_uri_with_credentials(shovel.src_uri)) %></td>
5260
<td><%= fmt_shovel_endpoint('src_', shovel) %></td>

deps/rabbitmq_shovel_management/src/rabbit_shovel_mgmt_util.erl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ status(Node) ->
4242
[format(Node, I) || I <- Status]
4343
end.
4444

45-
format(Node, {Name, Type, Info, _Metrics, TS}) ->
45+
format(Node, {Name, Type, Info, Metrics, TS}) ->
4646
[{node, Node}, {timestamp, format_ts(TS)}] ++
4747
format_name(Type, Name) ++
48+
format_metrics(Metrics) ++
4849
format_info(Info);
4950
format(Node, {Name, Type, Info, TS}) ->
5051
[{node, Node}, {timestamp, format_ts(TS)}] ++
@@ -57,6 +58,11 @@ format_name(dynamic, {VHost, Name}) -> [{name, Name},
5758
{vhost, VHost},
5859
{type, dynamic}].
5960

61+
format_metrics(undefined) ->
62+
[];
63+
format_metrics(Metrics) when is_map(Metrics) ->
64+
maps:to_list(Metrics).
65+
6066
format_info(starting) ->
6167
[{state, starting}];
6268

0 commit comments

Comments
 (0)