home
/
code
/
beam_stats.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add reductions delta.
[beam_stats.git]
/
src
/
beam_stats_state.erl
diff --git
a/src/beam_stats_state.erl
b/src/beam_stats_state.erl
index
17f9c90
..
4dcadd6
100644
(file)
--- a/
src/beam_stats_state.erl
+++ b/
src/beam_stats_state.erl
@@
-24,6
+24,8
@@
, previous_context_switches :: non_neg_integer()
, current_context_switches :: non_neg_integer()
, previous_context_switches :: non_neg_integer()
, current_context_switches :: non_neg_integer()
+
+ , reductions :: non_neg_integer()
}).
-define(T, #?MODULE).
}).
-define(T, #?MODULE).
@@
-38,6
+40,7
@@
new() ->
, {output , CurrentIOBytesOut}
} = erlang:statistics(io),
{CurrentContextSwitches, 0} = erlang:statistics(context_switches),
, {output , CurrentIOBytesOut}
} = erlang:statistics(io),
{CurrentContextSwitches, 0} = erlang:statistics(context_switches),
+ {_ReductionsTotal, ReductionsDelta} = erlang:statistics(reductions),
?T
{ timestamp = os:timestamp()
, node_id = erlang:node()
?T
{ timestamp = os:timestamp()
, node_id = erlang:node()
@@
-48,6
+51,7
@@
new() ->
, current_io_bytes_out = CurrentIOBytesOut
, previous_context_switches = 0
, current_context_switches = CurrentContextSwitches
, current_io_bytes_out = CurrentIOBytesOut
, previous_context_switches = 0
, current_context_switches = CurrentContextSwitches
+ , reductions = ReductionsDelta
}.
-spec update(t()) ->
}.
-spec update(t()) ->
@@
-62,6
+66,7
@@
update(?T
, {output , CurrentIOBytesOut}
} = erlang:statistics(io),
{CurrentContextSwitches, 0} = erlang:statistics(context_switches),
, {output , CurrentIOBytesOut}
} = erlang:statistics(io),
{CurrentContextSwitches, 0} = erlang:statistics(context_switches),
+ {_ReductionsTotal, ReductionsDelta} = erlang:statistics(reductions),
?T
{ timestamp = os:timestamp()
, node_id = erlang:node()
?T
{ timestamp = os:timestamp()
, node_id = erlang:node()
@@
-72,6
+77,7
@@
update(?T
, current_io_bytes_out = CurrentIOBytesOut
, previous_context_switches = PreviousContextSwitches
, current_context_switches = CurrentContextSwitches
, current_io_bytes_out = CurrentIOBytesOut
, previous_context_switches = PreviousContextSwitches
, current_context_switches = CurrentContextSwitches
+ , reductions = ReductionsDelta
}.
-spec export(t()) ->
}.
-spec export(t()) ->
@@
-87,6
+93,7
@@
export(
, current_io_bytes_out = CurrentIOBytesOut
, previous_context_switches = PreviousContextSwitches
, current_context_switches = CurrentContextSwitches
, current_io_bytes_out = CurrentIOBytesOut
, previous_context_switches = PreviousContextSwitches
, current_context_switches = CurrentContextSwitches
+ , reductions = Reductions
}
) ->
#beam_stats
}
) ->
#beam_stats
@@
-96,4
+103,5
@@
export(
, io_bytes_in = CurrentIOBytesIn - PreviousIOBytesIn
, io_bytes_out = CurrentIOBytesOut - PreviousIOBytesOut
, context_switches = CurrentContextSwitches - PreviousContextSwitches
, io_bytes_in = CurrentIOBytesIn - PreviousIOBytesIn
, io_bytes_out = CurrentIOBytesOut - PreviousIOBytesOut
, context_switches = CurrentContextSwitches - PreviousContextSwitches
+ , reductions = Reductions
}.
}.
This page took
0.03291 seconds
and
4
git commands to generate.