Skip to content

Commit 1a06bc0

Browse files
committed
Rabbitmqctl shovel_status: handle metrics
The ctl command got broken when metrics were added to the status. As we have the metrics now, we just report them.
1 parent a5106c6 commit 1a06bc0

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

deps/rabbitmq_shovel/src/Elixir.RabbitMQ.CLI.Ctl.Commands.ShovelStatusCommand.erl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,12 @@ aliases() ->
7575
[].
7676

7777
output({stream, ShovelStatus}, _Opts) ->
78-
Formatted = [fmt_name(Name,
79-
fmt_status(Status,
80-
#{type => Type,
81-
last_changed => fmt_ts(Timestamp)}))
82-
|| {Name, Type, Status, Timestamp} <- ShovelStatus],
78+
Formatted = [fmt_metrics(Metrics,
79+
fmt_name(Name,
80+
fmt_status(Status,
81+
#{type => Type,
82+
last_changed => fmt_ts(Timestamp)})))
83+
|| {Name, Type, Status, Metrics, Timestamp} <- ShovelStatus],
8384
{stream, Formatted};
8485
output(E, _Opts) ->
8586
'Elixir.RabbitMQ.CLI.DefaultOutput':output(E).
@@ -129,3 +130,6 @@ details_to_map(Proplist) ->
129130
{dest_exchange, destination_exchange}, {dest_exchange_key, destination_exchange_key}],
130131
maps:from_list([{New, proplists:get_value(Old, Proplist)}
131132
|| {Old, New} <- Keys, proplists:is_defined(Old, Proplist)]).
133+
134+
fmt_metrics(Metrics, Map) ->
135+
maps:merge(Metrics, Map).

0 commit comments

Comments
 (0)