Skip to content
This repository was archived by the owner on Nov 17, 2020. It is now read-only.

Commit 004a3d8

Browse files
Merge pull request #107 from rabbitmq/rabbitmq-management-211
Report reductions and garbage collection options in connection stats
2 parents b60a04b + 84f0833 commit 004a3d8

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/rabbit_channel.erl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@
160160
acks_uncommitted,
161161
prefetch_count,
162162
global_prefetch_count,
163-
state]).
163+
state,
164+
reductions,
165+
garbage_collection]).
164166

165167
-define(CREATION_EVENT_KEYS,
166168
[pid,
@@ -1971,6 +1973,12 @@ i(state, #ch{state = State}) -> State;
19711973
i(prefetch_count, #ch{consumer_prefetch = C}) -> C;
19721974
i(global_prefetch_count, #ch{limiter = Limiter}) ->
19731975
rabbit_limiter:get_prefetch_limit(Limiter);
1976+
i(garbage_collection, _State) ->
1977+
{garbage_collection, GC} = erlang:process_info(self(), garbage_collection),
1978+
GC;
1979+
i(reductions, _State) ->
1980+
{reductions, Reductions} = erlang:process_info(self(), reductions),
1981+
Reductions;
19741982
i(Item, _) ->
19751983
throw({bad_argument, Item}).
19761984

src/rabbit_reader.erl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@
153153
}).
154154

155155
-define(STATISTICS_KEYS, [pid, recv_oct, recv_cnt, send_oct, send_cnt,
156-
send_pend, state, channels]).
156+
send_pend, state, channels, reductions,
157+
garbage_collection]).
157158

158159
-define(CREATION_EVENT_KEYS,
159160
[pid, name, port, peer_port, host,
@@ -1400,6 +1401,12 @@ i(state, #v1{connection_state = ConnectionState,
14001401
true -> flow;
14011402
false -> ConnectionState
14021403
end;
1404+
i(garbage_collection, _State) ->
1405+
{garbage_collection, GC} = erlang:process_info(self(), garbage_collection),
1406+
GC;
1407+
i(reductions, _State) ->
1408+
{reductions, Reductions} = erlang:process_info(self(), reductions),
1409+
Reductions;
14031410
i(Item, #v1{connection = Conn}) -> ic(Item, Conn).
14041411

14051412
ic(name, #connection{name = Name}) -> Name;

0 commit comments

Comments
 (0)