X-Git-Url: https://git.xandkar.net/?p=beam_stats.git;a=blobdiff_plain;f=src%2Fbeam_stats_consumer_graphite.erl;h=6e0d5dd39ef019b4b148004c235dcbcd1adf9d94;hp=e788d298691a22034829b78554b0be9759483327;hb=101874c36980f5c738575c0143ae673c0797b6d4;hpb=53bff5d28dec1808fa664c4b7d50009b3fada8f7 diff --git a/src/beam_stats_consumer_graphite.erl b/src/beam_stats_consumer_graphite.erl index e788d29..6e0d5dd 100644 --- a/src/beam_stats_consumer_graphite.erl +++ b/src/beam_stats_consumer_graphite.erl @@ -123,9 +123,9 @@ beam_stats_to_bin(#beam_stats TimestampInt = timestamp_to_integer(Timestamp), TimestampBin = integer_to_binary(TimestampInt), <> = node_id_to_bin(NodeID), - PairToBin = make_pair_to_bin(NodeIDBin, TimestampBin), + MemoryPairToBin = make_pair_to_bin(NodeIDBin, TimestampBin, <<"memory">>), MemoryBinPairs = lists:map(fun atom_int_to_bin_bin/1, Memory), - MemoryBins = lists:map(PairToBin, MemoryBinPairs), + MemoryBins = lists:map(MemoryPairToBin, MemoryBinPairs), AllBins = [ MemoryBins ], @@ -136,14 +136,16 @@ beam_stats_to_bin(#beam_stats timestamp_to_integer({Megaseconds, Seconds, _}) -> Megaseconds * 1000000 + Seconds. --spec make_pair_to_bin(binary(), binary()) -> +-spec make_pair_to_bin(binary(), binary(), binary()) -> fun(({binary(), binary()}) -> binary()). -make_pair_to_bin(<>, <>) -> +make_pair_to_bin(<>, <>, <>) -> fun ({<>, <>}) -> << ?GRAPHITE_PATH_PREFIX , "." , NodeID/binary , "." + , Type/binary + , "." , K/binary , " " , V/binary