X-Git-Url: https://git.xandkar.net/?p=beam_stats.git;a=blobdiff_plain;f=src%2Fbeam_stats_state.erl;h=1fff6b0d77c98c637623d69d5c70e7477a77e713;hp=4dcadd6aa32ace7745ca187e0392343592544e70;hb=deefeb3c22860ae87538cdbde852a3f8ba0ee7c0;hpb=142c0796ba129bf10a47dfa447b460bb8fa123a5 diff --git a/src/beam_stats_state.erl b/src/beam_stats_state.erl index 4dcadd6..1fff6b0 100644 --- a/src/beam_stats_state.erl +++ b/src/beam_stats_state.erl @@ -26,6 +26,7 @@ , current_context_switches :: non_neg_integer() , reductions :: non_neg_integer() + , run_queue :: non_neg_integer() }). -define(T, #?MODULE). @@ -41,6 +42,7 @@ new() -> } = erlang:statistics(io), {CurrentContextSwitches, 0} = erlang:statistics(context_switches), {_ReductionsTotal, ReductionsDelta} = erlang:statistics(reductions), + RunQueue = erlang:statistics(run_queue), ?T { timestamp = os:timestamp() , node_id = erlang:node() @@ -52,6 +54,7 @@ new() -> , previous_context_switches = 0 , current_context_switches = CurrentContextSwitches , reductions = ReductionsDelta + , run_queue = RunQueue }. -spec update(t()) -> @@ -67,6 +70,7 @@ update(?T } = erlang:statistics(io), {CurrentContextSwitches, 0} = erlang:statistics(context_switches), {_ReductionsTotal, ReductionsDelta} = erlang:statistics(reductions), + RunQueue = erlang:statistics(run_queue), ?T { timestamp = os:timestamp() , node_id = erlang:node() @@ -78,6 +82,7 @@ update(?T , previous_context_switches = PreviousContextSwitches , current_context_switches = CurrentContextSwitches , reductions = ReductionsDelta + , run_queue = RunQueue }. -spec export(t()) -> @@ -94,6 +99,7 @@ export( , previous_context_switches = PreviousContextSwitches , current_context_switches = CurrentContextSwitches , reductions = Reductions + , run_queue = RunQueue } ) -> #beam_stats @@ -104,4 +110,5 @@ export( , io_bytes_out = CurrentIOBytesOut - PreviousIOBytesOut , context_switches = CurrentContextSwitches - PreviousContextSwitches , reductions = Reductions + , run_queue = RunQueue }.