Implement deltas server, replacing beam_stats_state.
[beam_stats.git] / src / beam_stats.erl
1 -module(beam_stats).
2
3 -include("include/beam_stats.hrl").
4
5 -export_type(
6 [ t/0
7 ]).
8
9 -export(
10 [ collect/1
11 ]).
12
13 -define(T, #?MODULE).
14
15 -type t() ::
16 ?T{}.
17
18 -spec collect(beam_stats_delta:t()) ->
19 t().
20 collect(DeltasServer) ->
21 {_, DeltaOfReductions} = beam_stats_source:erlang_statistics(reductions),
22 { {io_bytes_in , DeltaOfIOBytesIn}
23 , {io_bytes_out , DeltaOfIOBytesOut}
24 } = beam_stats_delta:of_io(DeltasServer),
25 ?T
26 { timestamp = beam_stats_source:os_timestamp()
27 , node_id = beam_stats_source:erlang_node()
28 , memory = beam_stats_source:erlang_memory()
29 , io_bytes_in = DeltaOfIOBytesIn
30 , io_bytes_out = DeltaOfIOBytesOut
31 , context_switches = beam_stats_delta:of_context_switches(DeltasServer)
32 , reductions = DeltaOfReductions
33 , run_queue = beam_stats_source:erlang_statistics(run_queue)
34 , ets = beam_stats_ets:collect()
35 , processes = beam_stats_processes:collect()
36 }.
This page took 0.050109 seconds and 4 git commands to generate.