fix: list append when cons was intended.
[beam_stats.git] / src / beam_stats_msg_graphite.erl
index 5b4e6e2..6883ff1 100644 (file)
@@ -14,6 +14,7 @@
 -export(
     [ of_beam_stats/1
     , to_bin/1
+    , path_to_bin/1
     ]).
 
 -define(T, #?MODULE).
@@ -69,12 +70,17 @@ to_bin(
     , 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
 %% ============================================================================
@@ -179,10 +185,10 @@ of_process(
     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()) ->
This page took 0.032583 seconds and 4 git commands to generate.