feat: reduce per-process granularity even further 0.12.0
authorSiraaj Khandkar <siraaj@khandkar.net>
Thu, 24 Sep 2015 22:30:28 +0000 (18:30 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Thu, 24 Sep 2015 22:30:28 +0000 (18:30 -0400)
In Graphite messages, replace references to specific PIDs with the string "PID".

src/beam_stats.app.src
src/beam_stats_msg_graphite.erl
test/beam_stats_consumer_statsd_SUITE.erl

index 56f2133..24f8b70 100644 (file)
@@ -1,7 +1,7 @@
 {application, beam_stats,
  [
   {description, "Periodic VM stats production and consumption."},
-  {vsn, "0.11.0"},
+  {vsn, "0.12.0"},
   {registered, []},
   {applications,
     [ kernel
index 22990a4..87dae3e 100644 (file)
@@ -253,12 +253,7 @@ ancestors_to_bin([A | Ancestors]) ->
 ancestor_to_bin(A) when is_atom(A) ->
     atom_to_binary(A, utf8);
 ancestor_to_bin(A) when is_pid(A) ->
-    pid_to_bin(A).
-
-pid_to_bin(Pid) ->
-    PidList = erlang:pid_to_list(Pid),
-    PidBin = re:replace(PidList, "[\.]", "_", [global, {return, binary}]),
-             re:replace(PidBin , "[><]", "" , [global, {return, binary}]).
+    <<"PID">>.
 
 -spec mfa_to_bin(mfa()) ->
     binary().
index 43c1a1f..f151c32 100644 (file)
@@ -129,10 +129,10 @@ t_full_cycle(_Cfg) ->
         , <<"beam_stats.node_foo_host_bar.process_message_queue_len.spawned-via--bar_mod-bar_fun-1--NONE--NONE:5|g">>
 
         % Process 3 and 4, aggregated by origin
-        , <<"beam_stats.node_foo_host_bar.process_memory.spawned-via--baz_mod-baz_fun-3--baz_otp_mod-baz_otp_fun-2--0_0_0-0_1_0:30|g">>
-        , <<"beam_stats.node_foo_host_bar.process_total_heap_size.spawned-via--baz_mod-baz_fun-3--baz_otp_mod-baz_otp_fun-2--0_0_0-0_1_0:45|g">>
-        , <<"beam_stats.node_foo_host_bar.process_stack_size.spawned-via--baz_mod-baz_fun-3--baz_otp_mod-baz_otp_fun-2--0_0_0-0_1_0:55|g">>
-        , <<"beam_stats.node_foo_host_bar.process_message_queue_len.spawned-via--baz_mod-baz_fun-3--baz_otp_mod-baz_otp_fun-2--0_0_0-0_1_0:1|g">>
+        , <<"beam_stats.node_foo_host_bar.process_memory.spawned-via--baz_mod-baz_fun-3--baz_otp_mod-baz_otp_fun-2--PID-PID:30|g">>
+        , <<"beam_stats.node_foo_host_bar.process_total_heap_size.spawned-via--baz_mod-baz_fun-3--baz_otp_mod-baz_otp_fun-2--PID-PID:45|g">>
+        , <<"beam_stats.node_foo_host_bar.process_stack_size.spawned-via--baz_mod-baz_fun-3--baz_otp_mod-baz_otp_fun-2--PID-PID:55|g">>
+        , <<"beam_stats.node_foo_host_bar.process_message_queue_len.spawned-via--baz_mod-baz_fun-3--baz_otp_mod-baz_otp_fun-2--PID-PID:1|g">>
         ],
     MsgsReceived = binary:split(PacketsCombined, <<"\n">>, [global, trim]),
     RemoveExpectedFromReceived =
This page took 0.026634 seconds and 4 git commands to generate.