{"id":18554645,"url":"https://github.com/erlanglab/elab_poller","last_synced_at":"2025-04-09T23:31:43.675Z","repository":{"id":48901376,"uuid":"353942627","full_name":"erlanglab/elab_poller","owner":"erlanglab","description":null,"archived":true,"fork":false,"pushed_at":"2021-07-06T11:32:43.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T11:14:24.721Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erlanglab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-02T07:32:36.000Z","updated_at":"2024-09-22T04:32:07.000Z","dependencies_parsed_at":"2022-09-23T23:31:37.270Z","dependency_job_id":null,"html_url":"https://github.com/erlanglab/elab_poller","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlanglab%2Felab_poller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlanglab%2Felab_poller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlanglab%2Felab_poller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlanglab%2Felab_poller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erlanglab","download_url":"https://codeload.github.com/erlanglab/elab_poller/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248129814,"owners_count":21052644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T21:23:06.714Z","updated_at":"2025-04-09T23:31:38.664Z","avatar_url":"https://github.com/erlanglab.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"elab_poller\n=====\n\nAn OTP library extending [telemetry_poller](https://github.com/beam-telemetry/telemetry_poller), a tool using [telemetry](https://github.com/beam-telemetry/telemetry) library.\nBoth dependencies are installed with usage of rebar3.\n\nBuild\n-----\n\n    $ rebar3 compile\n\nGetting started\n---------------\nTo use elab_poller in your project you have to add telemetry_handler_table to your supervision tree to manage handlers\n\n```erlang\ntelemetry_handler_table:start_link()\n```\n\nWhen handler table is working you can attach handlers for given events\n\n```erlang\ntelemetry:attach(\n        unique-id,\n        [event type, event],\n        fun handler_function/4,\n        []\n    )\n```\n\nand start telemetry_poller to gather data periodically\n\n```erlang\ntelemetry_poller:start_link([{measurements, [{module, event, []}]}])\n```\n\nFunctionalities\n---------------\nIn `elab_poller` module there are defined two functions for gathering measurements:\n* `microstate_accounting/0` that is collecting data from `erlang:statistics(microstate_accounting)` and aggregate them per microstate type\n* `allocator_sizes/0` gets data from `erlang:system_info({allocator_sizes, Allocator})` for allocators returned by `erlang:system_info(alloc_util_allocators)`\n\nModule `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\n`[vm, memory]`, `[vm, total_run_queue_lengths]` and `[vm, system_counts]`. \n\nFor now the measurements are parsed and written to .csv file.\n\nExample\n-------\nExample how you can collect microstate_accounting data:\n```erlang\ntelemetry_handler_table:start_link(),\ntelemetry:attach(\n    \u003c\u003c\"logger-mc\"\u003e\u003e,\n    [vm, microstate_accounting],\n    fun elab_aggregators:microstate_accounting_aggregator/4,\n    []\n),\ntelemetry_poller:start_link([{measurements, [{elab_poller, microstate_accounting, []}]}]).\n```\n\n ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferlanglab%2Felab_poller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferlanglab%2Felab_poller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferlanglab%2Felab_poller/lists"}