Implement deltas server, replacing beam_stats_state.
[beam_stats.git] / test / beam_stats_consumer_statsd_SUITE.erl
index 2283ed9..88f82e7 100644 (file)
@@ -38,11 +38,7 @@ groups() ->
 
 t_full_cycle(_Cfg) ->
     meck:new(beam_stats_source),
-    BEAMStatsExpected = meck_expect_beam_stats(),
-    BEAMStatsComputed = beam_stats_state:export(beam_stats_state:new()),
-    ct:log("BEAMStatsExpected: ~p~n", [BEAMStatsExpected]),
-    ct:log("BEAMStatsComputed: ~p~n", [BEAMStatsComputed]),
-    BEAMStatsExpected = BEAMStatsComputed,
+    _BEAMStatsExpected = meck_expect_beam_stats(),
 
     {ok,[hope,beam_stats]} = application:ensure_all_started(beam_stats),
     ct:log("beam_stats started~n"),
@@ -101,10 +97,10 @@ t_full_cycle(_Cfg) ->
         , <<"beam_stats_v0.node_foo_host_bar.memory.mem_type_foo:1|g">>
         , <<"beam_stats_v0.node_foo_host_bar.memory.mem_type_bar:2|g">>
         , <<"beam_stats_v0.node_foo_host_bar.memory.mem_type_baz:3|g">>
-        , <<"beam_stats_v0.node_foo_host_bar.ets_table.size.foo.foo:5|g">>
-        , <<"beam_stats_v0.node_foo_host_bar.ets_table.memory.foo.foo:40|g">>
-        , <<"beam_stats_v0.node_foo_host_bar.ets_table.size.bar.37:8|g">>
-        , <<"beam_stats_v0.node_foo_host_bar.ets_table.memory.bar.37:64|g">>
+        , <<"beam_stats_v0.node_foo_host_bar.ets_table.size.foo.NAMED:5|g">>
+        , <<"beam_stats_v0.node_foo_host_bar.ets_table.memory.foo.NAMED:40|g">>
+        , <<"beam_stats_v0.node_foo_host_bar.ets_table.size.bar.TID:16|g">>
+        , <<"beam_stats_v0.node_foo_host_bar.ets_table.memory.bar.TID:128|g">>
 
         % Processes totals
         , <<"beam_stats_v0.node_foo_host_bar.processes_count_all:4|g">>
@@ -247,13 +243,20 @@ meck_expect_beam_stats(Overrides) ->
         , size   = 5
         , memory = 40
         },
-    ETSTableStatsBar =
+    ETSTableStatsBarA =
         #beam_stats_ets_table
         { id     = 37
         , name   = bar
         , size   = 8
         , memory = 64
         },
+    ETSTableStatsBarB =
+        #beam_stats_ets_table
+        { id     = 38
+        , name   = bar
+        , size   = 8
+        , memory = 64
+        },
     meck:expect(beam_stats_source, erlang_memory,
         fun () -> [{mem_type_foo, 1}, {mem_type_bar, 2}, {mem_type_baz, 3}] end),
     meck:expect(beam_stats_source, erlang_node,
@@ -268,16 +271,21 @@ meck_expect_beam_stats(Overrides) ->
         end
     ),
     meck:expect(beam_stats_source, ets_all,
-        fun () -> [foo, 37] end),
+        fun () -> [foo, 37, 38] end),
     meck:expect(beam_stats_source, erlang_system_info,
         fun (wordsize) -> 8 end),
     meck:expect(beam_stats_source, ets_info,
         fun (foo, memory) -> 5
         ;   (foo, name  ) -> foo
         ;   (foo, size  ) -> 5
+
         ;   (37 , memory) -> 8
         ;   (37 , name  ) -> bar
         ;   (37 , size  ) -> 8
+
+        ;   (38 , memory) -> 8
+        ;   (38 , name  ) -> bar
+        ;   (38 , size  ) -> 8
         end
     ),
     meck:expect(beam_stats_source, erlang_processes,
@@ -348,6 +356,6 @@ meck_expect_beam_stats(Overrides) ->
     , context_switches = ContextSwitches
     , reductions       = 9
     , run_queue        = 17
-    , ets              = [ETSTableStatsFoo, ETSTableStatsBar]
+    , ets              = [ETSTableStatsFoo, ETSTableStatsBarA, ETSTableStatsBarB]
     , processes        = Processes
     }.
This page took 0.02767 seconds and 4 git commands to generate.