Skip to content

Commit 6e871f6

Browse files
ikavgomichaelklishin
authored andcommitted
RMQ-1263: Shovels Management: show metrics (incl. forwarded counter) in the Shovel Status page
(cherry picked from commit f90dab71f147548c5e9ad921a0bc618179bd34c2) Conflicts: deps/rabbitmq_shovel_management/src/rabbit_shovel_mgmt_util.erl
1 parent bb7cd83 commit 6e871f6

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

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</th>
21+
<th>Remaining Unacked</th>
22+
<th>Pending</th>
23+
<th>Forwarded</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)