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
This commit is contained in:
Iliia Khaprov 2025-02-14 11:17:43 +01:00 committed by Michael Klishin
parent bb7cd8381e
commit 6e871f6ab3
No known key found for this signature in database
GPG Key ID: FF4F6501646A9C9A
2 changed files with 16 additions and 2 deletions

View File

@ -17,6 +17,10 @@
<th>Virtual Host</th>
<% } %>
<th>State</th>
<th>Remaining</th>
<th>Remaining Unacked</th>
<th>Pending</th>
<th>Forwarded</th>
<th colspan="3">Source</th>
<th colspan="3">Destination</th>
<th>Last changed</th>
@ -47,6 +51,10 @@
<td><%= shovel.timestamp %></td>
<% } else { %>
<td><%= fmt_object_state(shovel) %></td>
<td><%= fmt_string(shovel.remaining) %></td>
<td><%= fmt_string(shovel.remaining_unacked) %></td>
<td><%= fmt_string(shovel.pending) %></td>
<td><%= fmt_string(shovel.forwarded) %></td>
<td><%= fmt_string(shovel.src_protocol) %></td>
<td><%= shovel.src_uri == undefined ? fmt_string(shovel.src_uri) : fmt_string(fmt_uri_with_credentials(shovel.src_uri)) %></td>
<td><%= fmt_shovel_endpoint('src_', shovel) %></td>

View File

@ -42,9 +42,10 @@ status(Node) ->
[format(Node, I) || I <- Status]
end.
format(Node, {Name, Type, Info, _Metrics, TS}) ->
format(Node, {Name, Type, Info, Metrics, TS}) ->
[{node, Node}, {timestamp, format_ts(TS)}] ++
format_name(Type, Name) ++
format_metrics(Metrics) ++
format_info(Info);
format(Node, {Name, Type, Info, TS}) ->
[{node, Node}, {timestamp, format_ts(TS)}] ++
@ -57,6 +58,11 @@ format_name(dynamic, {VHost, Name}) -> [{name, Name},
{vhost, VHost},
{type, dynamic}].
format_metrics(undefined) ->
[];
format_metrics(Metrics) when is_map(Metrics) ->
maps:to_list(Metrics).
format_info(starting) ->
[{state, starting}];