Skip to content

Commit accd6aa

Browse files
committed
Comment optimisation in format channel stats
[#152240490]
1 parent b55f79d commit accd6aa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/rabbit_channel.erl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,6 +2008,10 @@ emit_stats(State) -> emit_stats(State, []).
20082008

20092009
emit_stats(State, Extra) ->
20102010
[{reductions, Red} | Coarse0] = infos(?STATISTICS_KEYS, State),
2011+
%% First metric must be `idle_since` (if available), as expected by
2012+
%% `rabbit_mgmt_format:format_channel_stats`. This is a performance
2013+
%% optimisation that avoids traversing the whole list when only
2014+
%% one element has to be formatted.
20112015
rabbit_core_metrics:channel_stats(self(), Extra ++ Coarse0),
20122016
rabbit_core_metrics:channel_stats(reductions, self(), Red).
20132017

0 commit comments

Comments
 (0)