-t_send(_Cfg) ->
- Pid0 = list_to_pid("<0.0.0>"),
- Pid1 = list_to_pid("<0.1.0>"),
- Pid2 = list_to_pid("<0.2.0>"),
- Pid3 = list_to_pid("<0.3.0>"),
- Process1 =
- #beam_stats_process
- { pid = Pid1
- , registered_name = {some, reg_name_foo}
- , ancestry =
- #beam_stats_process_ancestry
- { raw_initial_call = {foo_mod, foo_fun, 2}
- , otp_initial_call = none
- , otp_ancestors = none
- }
- , status = running
- , memory = 15
- , total_heap_size = 25
- , stack_size = 10
- , message_queue_len = 0
- },
- Process2 =
- #beam_stats_process
- { pid = Pid2
- , registered_name = none
- , ancestry =
- #beam_stats_process_ancestry
- { raw_initial_call = {bar_mod, bar_fun, 1}
- , otp_initial_call = none
- , otp_ancestors = none
- }
- , status = running
- , memory = 25
- , total_heap_size = 35
- , stack_size = 40
- , message_queue_len = 5
- },
- Process3 =
- #beam_stats_process
- { pid = Pid3
- , registered_name = none
- , ancestry =
- #beam_stats_process_ancestry
- { raw_initial_call = {baz_mod, baz_fun, 3}
- , otp_initial_call = {some, {baz_otp_mod, baz_otp_fun, 2}}
- , otp_ancestors = {some, [Pid0, Pid1]}
- }
- , status = running
- , memory = 25
- , total_heap_size = 35
- , stack_size = 40
- , message_queue_len = 1
- },
- Processes =
- #beam_stats_processes
- { individual_stats =
- [ Process1
- , Process2
- , Process3
- ]
- , count_all = 3
- , count_exiting = 0
- , count_garbage_collecting = 0
- , count_registered = 1
- , count_runnable = 0
- , count_running = 3
- , count_suspended = 0
- , count_waiting = 0
- },
- 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'
- , memory = [{mem_type_foo, 1}, {mem_type_bar, 2}, {mem_type_baz, 3}]
- , io_bytes_in = 3
- , io_bytes_out = 7
- , context_switches = 5
- , reductions = 9
- , run_queue = 17
- , ets = [ETSTableStatsFoo, ETSTableStatsBar]
- , processes = Processes
- },
+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,
+
+ {ok,[hope,beam_stats]} = application:ensure_all_started(beam_stats),
+ ct:log("beam_stats started~n"),