Skip to content

Commit

Permalink
Include sessions in format_status/1
Browse files Browse the repository at this point in the history
Include monitored session pids in format_status/1 of rabbit_amqp_writer.
They could be useful when debugging.
The maximum number of sessions per connection is limited, hence the
output won't be too large.
  • Loading branch information
ansd committed Jan 16, 2025
1 parent 84eda12 commit 290889b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions deps/rabbit/src/rabbit_amqp_writer.erl
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,15 @@ format_status(Status) ->
fun(#state{sock = Sock,
reader = Reader,
pending = Pending,
pending_size = PendingSize}) ->
pending_size = PendingSize,
monitored_sessions = Sessions
}) ->
#{socket => Sock,
reader => Reader,
%% Below 2 fields should always have the same value.
pending => iolist_size(Pending),
pending_size => PendingSize}
pending_size => PendingSize,
monitored_sessions => maps:keys(Sessions)}
end,
Status).

Expand Down

0 comments on commit 290889b

Please sign in to comment.