X-Git-Url: https://git.xandkar.net/?p=beam_stats.git;a=blobdiff_plain;f=src%2Fbeam_stats_consumer_csv.erl;h=6b271068f489064b7c576f335b74cd496b03538d;hp=c9d27855de4959c54dc88fc8bf509296373c8fd5;hb=101874c36980f5c738575c0143ae673c0797b6d4;hpb=53bff5d28dec1808fa664c4b7d50009b3fada8f7 diff --git a/src/beam_stats_consumer_csv.erl b/src/beam_stats_consumer_csv.erl index c9d2785..6b27106 100644 --- a/src/beam_stats_consumer_csv.erl +++ b/src/beam_stats_consumer_csv.erl @@ -101,9 +101,9 @@ beam_stats_to_bin(#beam_stats ) -> <> = timestamp_to_bin(Timestamp), <> = 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 ], @@ -131,14 +131,16 @@ timestamp_to_float({ComponentMega, ComponentWhole, ComponentMicro}) -> TotalMicroSeconds = (TotalWholeSeconds * OneMillion) + ComponentMicro, TotalMicroSeconds / OneMillion. --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 ({<>, <>}) -> << TimestampBin/binary , "|" , NodeID/binary , "|" + , Type/binary + , "|" , K/binary , "|" , V/binary