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

Commit

Permalink
Merge branch 'master' into rabbitmq-server-500
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Jul 1, 2016
2 parents c082ad9 + a5d1a4f commit 6381608
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
10 changes: 9 additions & 1 deletion src/rabbit_channel.erl
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@
acks_uncommitted,
prefetch_count,
global_prefetch_count,
state]).
state,
reductions,
garbage_collection]).

-define(CREATION_EVENT_KEYS,
[pid,
Expand Down Expand Up @@ -2000,6 +2002,12 @@ i(global_prefetch_count, #ch{limiter = Limiter}) ->
rabbit_limiter:get_prefetch_limit(Limiter);
i(interceptors, #ch{interceptor_state = IState}) ->
IState;
i(garbage_collection, _State) ->
{garbage_collection, GC} = erlang:process_info(self(), garbage_collection),
GC;
i(reductions, _State) ->
{reductions, Reductions} = erlang:process_info(self(), reductions),
Reductions;
i(Item, _) ->
throw({bad_argument, Item}).

Expand Down
12 changes: 7 additions & 5 deletions src/rabbit_ct_helpers.erl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

log_environment() ->
Vars = lists:sort(fun(A, B) -> A =< B end, os:getenv()),
ct:pal("Environment variables:~n~s", [
ct:pal(?LOW_IMPORTANCE, "Environment variables:~n~s", [
[io_lib:format(" ~s~n", [V]) || V <- Vars]]).

run_setup_steps(Config) ->
Expand Down Expand Up @@ -289,7 +289,7 @@ long_running_testsuite_monitor(TimerRef, Testcases) ->
long_running_testsuite_monitor(TimerRef, Testcases1);
ping_ct ->
T1 = erlang:monotonic_time(seconds),
ct:pal("Testcases still in progress:~s",
ct:pal(?STD_IMPORTANCE, "Testcases still in progress:~s",
[[
begin
TDiff = format_time_diff(T1, T0),
Expand Down Expand Up @@ -435,7 +435,7 @@ exec([Cmd | Args], Options) when is_list(Cmd) orelse is_binary(Cmd) ->
"~n")
}
end,
ct:pal(Log1, [string:join([Cmd1 | Args1], " "), self()]),
ct:pal(?LOW_IMPORTANCE, Log1, [string:join([Cmd1 | Args1], " "), self()]),
Port = erlang:open_port(
{spawn_executable, Cmd1}, [
{args, Args1},
Expand All @@ -459,9 +459,11 @@ port_receive_loop(Port, Stdout, Options) ->
Stdout =:= "",
if
DropStdout ->
ct:pal("Exit code: ~p (pid ~p)", [X, self()]);
ct:pal(?LOW_IMPORTANCE, "Exit code: ~p (pid ~p)",
[X, self()]);
true ->
ct:pal("~s~nExit code: ~p (pid ~p)", [Stdout, X, self()])
ct:pal(?LOW_IMPORTANCE, "~s~nExit code: ~p (pid ~p)",
[Stdout, X, self()])
end,
case proplists:get_value(match_stdout, Options) of
undefined ->
Expand Down
9 changes: 8 additions & 1 deletion src/rabbit_reader.erl
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@
}).

-define(STATISTICS_KEYS, [pid, recv_oct, recv_cnt, send_oct, send_cnt,
send_pend, state, channels]).
send_pend, state, channels, reductions,
garbage_collection]).

-define(CREATION_EVENT_KEYS,
[pid, name, port, peer_port, host,
Expand Down Expand Up @@ -1390,6 +1391,12 @@ i(state, #v1{connection_state = ConnectionState,
_ -> ConnectionState
end
end;
i(garbage_collection, _State) ->
{garbage_collection, GC} = erlang:process_info(self(), garbage_collection),
GC;
i(reductions, _State) ->
{reductions, Reductions} = erlang:process_info(self(), reductions),
Reductions;
i(Item, #v1{connection = Conn}) -> ic(Item, Conn).

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

0 comments on commit 6381608

Please sign in to comment.