Collect ETS per-table memory and size.
[beam_stats.git] / test / beam_stats_consumer_statsd_SUITE.erl
index f0cffb0..dd01455 100644 (file)
@@ -1,6 +1,7 @@
 -module(beam_stats_consumer_statsd_SUITE).
 
 -include_lib("beam_stats/include/beam_stats.hrl").
+-include_lib("beam_stats/include/beam_stats_ets_table.hrl").
 
 -export(
     [ all/0
@@ -33,6 +34,21 @@ groups() ->
 %% =============================================================================
 
 t_send(_Cfg) ->
+    ETSTableStatsFoo =
+        #beam_stats_ets_table
+        { id     = foo
+        , name   = foo
+        , size   = 5
+        , memory = 25
+        },
+    ETSTableStatsBar =
+        #beam_stats_ets_table
+        { id     = 37
+        , name   = bar
+        , size   = 8
+        , memory = 38
+        },
+    % TODO: Indent #beam_stats as #beam_stats_ets_table
     BEAMStats = #beam_stats
     { timestamp = {1, 2, 3}
     , node_id   = 'node_foo@host_bar'
@@ -42,6 +58,7 @@ t_send(_Cfg) ->
     , context_switches = 5
     , reductions       = 9
     , run_queue        = 17
+    , ets              = [ETSTableStatsFoo, ETSTableStatsBar]
     },
     ServerPort = 8125,
     {ok, ServerSocket} = gen_udp:open(ServerPort, [binary, {active, false}]),
@@ -60,4 +77,8 @@ t_send(_Cfg) ->
      , "beam_stats.node_foo_host_bar.reductions:9|g\n"
      , "beam_stats.node_foo_host_bar.run_queue:17|g\n"
      , "beam_stats.node_foo_host_bar.memory.mem_type_foo:1|g\n"
+     , "beam_stats.node_foo_host_bar.ets_table.size.foo.foo:5|g\n"
+     , "beam_stats.node_foo_host_bar.ets_table.memory.foo.foo:25|g\n"
+     , "beam_stats.node_foo_host_bar.ets_table.size.bar.37:8|g\n"
+     , "beam_stats.node_foo_host_bar.ets_table.memory.bar.37:38|g\n"
     >> = Data.
This page took 0.01905 seconds and 4 git commands to generate.