-export(
[ of_beam_stats/1
, to_bin/1
+ , path_to_bin/1
]).
-define(T, #?MODULE).
, timestamp = Timestamp
}
) ->
- PathBin = bin_join(Path, <<".">>),
+ PathBin = path_to_bin(Path),
ValueBin = integer_to_binary(Value),
TimestampInt = timestamp_to_integer(Timestamp),
TimestampBin = integer_to_binary(TimestampInt),
<<PathBin/binary, " ", ValueBin/binary, " ", TimestampBin/binary>>.
+-spec path_to_bin([binary()]) ->
+ binary().
+path_to_bin(Path) ->
+ bin_join(Path, <<".">>).
+
%% ============================================================================
%% Helpers
%% ============================================================================
OriginAndPid = [OriginBin, PidBin],
Ts = Timestamp,
N = NodeID,
- [ cons([N, <<"process_memory">> , OriginAndPid], Memory , Ts)
- , cons([N, <<"process_total_heap_size">> , OriginAndPid], TotalHeapSize , Ts)
- , cons([N, <<"process_stack_size">> , OriginAndPid], StackSize , Ts)
- , cons([N, <<"process_message_queue_len">> , OriginAndPid], MsgQueueLen , Ts)
+ [ cons([N, <<"process_memory">> | OriginAndPid], Memory , Ts)
+ , cons([N, <<"process_total_heap_size">> | OriginAndPid], TotalHeapSize , Ts)
+ , cons([N, <<"process_stack_size">> | OriginAndPid], StackSize , Ts)
+ , cons([N, <<"process_message_queue_len">> | OriginAndPid], MsgQueueLen , Ts)
].
-spec proc_origin_to_bin(beam_stats_process:best_known_origin()) ->