-record(beam_stats,
- { timestamp :: erlang:timestamp()
- , node_id :: atom()
- , memory :: [{atom(), non_neg_integer()}]
- , io_bytes_in :: non_neg_integer()
- , io_bytes_out :: non_neg_integer()
+ { timestamp :: erlang:timestamp()
+ , node_id :: atom()
+ , memory :: [{atom(), non_neg_integer()}]
+ , io_bytes_in :: non_neg_integer()
+ , io_bytes_out :: non_neg_integer()
, context_switches :: non_neg_integer()
, reductions :: non_neg_integer()
, run_queue :: non_neg_integer()
-type state() ::
#state{}.
--define(DEFAULT_HOST , "localhost").
--define(DEFAULT_PORT , 2003).
--define(DEFAULT_TIMEOUT , 5000).
+-define(DEFAULT_HOST , "localhost").
+-define(DEFAULT_PORT , 2003).
+-define(DEFAULT_TIMEOUT , 5000).
-spec init([option()]) ->
{non_neg_integer(), state()}.
, public
],
?T
- { erlang_statistics = ets:new(beam_stats_delta_erlang_statistics, Options)
+ { erlang_statistics =
+ ets:new(beam_stats_delta_erlang_statistics, Options)
, erlang_process_info_reductions =
ets:new(beam_stats_delta_erlang_process_info_reductions, Options)
}.
-spec stop(t()) ->
{}.
stop(?T
- { erlang_statistics = TidErlangStatistics
+ { erlang_statistics = TidErlangStatistics
, erlang_process_info_reductions = TidErlangProcessInfoReductions
}
) ->
{ pid = Pid
, registered_name = RegisteredNameOpt
, ancestry = #beam_stats_process_ancestry
- { raw_initial_call = InitialCallRaw
- , otp_initial_call = InitialCallOTPOpt
- , otp_ancestors = AncestorsOpt
+ { raw_initial_call = InitialCallRaw
+ , otp_initial_call = InitialCallOTPOpt
+ , otp_ancestors = AncestorsOpt
}
, status = Status
, memory = Memory
-define(PRODUCE_ASYNC , produce_async).
-record(state,
- { consumers = ordsets:new() :: ordsets:ordset(pid())
- , deltas_server :: beam_stats_delta:t()
+ { consumers = ordsets:new() :: ordsets:ordset(pid())
+ , deltas_server :: beam_stats_delta:t()
}).
-type state() ::
state().
produce(
#state
- { consumers = ConsumersSet
+ { consumers = ConsumersSet
, deltas_server = DeltasServer
}=State,
MsgSendFun