Skip to content

erlanglab/elab_poller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

elab_poller

An OTP library extending telemetry_poller, a tool using telemetry library. Both dependencies are installed with usage of rebar3.

Build

$ rebar3 compile

Getting started

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, []}]}])

Functionalities

In elab_poller module there are defined two functions for gathering measurements:

  • microstate_accounting/0 that is collecting data from erlang:statistics(microstate_accounting) and aggregate them per microstate type
  • allocator_sizes/0 gets data from erlang:system_info({allocator_sizes, Allocator}) for allocators returned by erlang: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

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, []}]}]).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages