Skip to content

Commit

Permalink
Add message_queue_len to sysmon handler
Browse files Browse the repository at this point in the history
az919

A large heap or long GC is a potential sign of a large mailbox.  Include the
mailbox size in the report.
  • Loading branch information
rzezeski committed Nov 2, 2011
1 parent 6b0e97a commit 4a2cacc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/riak_core_sysmon_handler.erl
Expand Up @@ -174,12 +174,13 @@ get_pretty_proc_info(Pid) ->
get_pretty_proc_info(Pid, current_function).

get_pretty_proc_info(Pid, Acf) ->
case process_info(Pid, [registered_name, initial_call, current_function]) of
case process_info(Pid, [registered_name, initial_call, current_function,
message_queue_len]) of
undefined ->
undefined;
[] ->
undefined;
[{registered_name, RN0}, ICT1, {_, CF}] ->
[{registered_name, RN0}, ICT1, {_, CF}, {_, MQL}] ->
ICT = case proc_lib:translate_initial_call(Pid) of
{proc_lib, init_p, 5} -> % not by proc_lib, see docs
ICT1;
Expand All @@ -189,5 +190,5 @@ get_pretty_proc_info(Pid, Acf) ->
RNL = if RN0 == [] -> [];
true -> [{name, RN0}]
end,
RNL ++ [ICT, {Acf, CF}]
RNL ++ [ICT, {Acf, CF}, {message_queue_len, MQL}]
end.

0 comments on commit 4a2cacc

Please sign in to comment.