An OTP library extending telemetry_poller, a tool using telemetry library. Both dependencies are installed with usage of rebar3.
$ rebar3 compile
To use elab_poller in your project you have to add telemetry_handler_table to your supervision tree to manage handlers
telemetry_handler_table:start_link()
When handler table is working you can attach handlers for given events
telemetry:attach(
unique-id,
[event type, event],
fun handler_function/4,
[]
)
and start telemetry_poller to gather data periodically
telemetry_poller:start_link([{measurements, [{module, event, []}]}])
In elab_poller
module there are defined two functions for gathering measurements:
microstate_accounting/0
that is collecting data fromerlang:statistics(microstate_accounting)
and aggregate them per microstate typeallocator_sizes/0
gets data fromerlang:system_info({allocator_sizes, Allocator})
for allocators returned byerlang:system_info(alloc_util_allocators)
Module elab_aggregators
contains handlers for events emited by functions in elab_poler.erl
- [vm, microstate_accounting]
, [vm, allocator_sizes]
and few default measurements provided by telemetry_poller, that is
[vm, memory]
, [vm, total_run_queue_lengths]
and [vm, system_counts]
.
For now the measurements are parsed and written to .csv file.
Example how you can collect microstate_accounting data:
telemetry_handler_table:start_link(),
telemetry:attach(
<<"logger-mc">>,
[vm, microstate_accounting],
fun elab_aggregators:microstate_accounting_aggregator/4,
[]
),
telemetry_poller:start_link([{measurements, [{elab_poller, microstate_accounting, []}]}]).