metrics

A generic interface to different metrics systems in Erlang.

Latest version: 2.5.0 registry icon
Maintenance score
0
Safety score
0
Popularity score
71
Check your open source dependency risks. Get immediate insight about security, stability and licensing risks.
Security
  Vulnerabilities
Version Suggest Low Medium High Critical
2.5.0 0 0 0 0 0
2.4.0 0 0 0 0 0
2.3.0 0 0 0 0 0
2.2.0 0 0 0 0 0
2.1.0 0 0 0 0 0
2.0.1 0 0 0 0 0
2.0.0 0 0 0 0 0
1.2.0 0 0 0 0 0
1.1.0 0 0 0 0 0
1.0.1 0 0 0 0 0
1.0.0 0 0 0 0 0
0.2.1 0 0 0 0 0
0.2.0 0 0 0 0 0
0.1.0 0 0 0 0 0

Stability
Latest release:

2.5.0 - This version may not be safe as it has not been updated for a long time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform

Licensing

Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.

BSD-3-Clause   -   BSD 3-Clause "New" or "Revised" License

Not a wildcard

Not proprietary

OSI Compliant



metrics: A generic interface to different metrics systems in Erlang.

Copyright (c) 2017-2018 BenoƮt Chesneau.

Version: 2.5.0

metrics

A generic interface to folsom, exometer, grapherl or any compliant interface. This application has been extracted from hackney.

Currently supported backend are:

If you need the support for another backend, please open a ticket.

Hex pm

Usage

Set a backend

The backend can be set in the application environment using the metrics_mod setting or using metrics:backend/1.

register a new metric:

metrics:new(counter, "c").

Depending on the backend the following metrics types can be passed: counter | histogram | gauge | meter | spiral

update a metric

A counter can simply be incremented by 1 using metrics:update/1. or by passing a positive or negative integer like this:

metrics:update("c", {c, 1}).

Other metrics are updated via metrics:update/2.

Example:

1> application:ensure_all_started(metrics).
{ok,[metrics]}
2> application:ensure_all_started(folsom).
{ok,[bear,folsom]}
3> metrics:backend(metrics_folsom).
ok
4> metrics:new(counter, "c").
ok
5> metrics:update("c").
ok
6> folsom_metrics:get_metric_value("c").
1
7> metrics:update("c", {c, 1}).
ok
8> folsom_metrics:get_metric_value("c").
2

Documentation

Full doc is available in the metrics module.

Build

$ rebar3 compile

Modules

metrics
metrics_exometer
metrics_folsom
metrics_noop
metrics_process_tracker
metrics_sup