Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A generic interface to different metrics systems in Erlang.

License

NotificationsYou must be signed in to change notification settings

benoitc/erlang-metrics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Version: 2.5.0

metrics

A generic interface to folsom, exometer, grapherl or any compliant interface. Thisapplication has been extracted fromhackney.

Currently supported backend are:

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

Hex pm

Usage

Set a backend

The backend can be set in the application environment using themetrics_mod setting or usingmetrics: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 usingmetrics:update/1. or by passing a positive or negative integer like this:

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

Other metrics are updated viametrics: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).ok4>metrics:new(counter,"c").ok5>metrics:update("c").ok6>folsom_metrics:get_metric_value("c").17>metrics:update("c", {c,1}).ok8>folsom_metrics:get_metric_value("c").2

Documentation

Full doc is available in themetrics module.

Build

$ rebar3 compile

Modules

metrics
metrics_exometer
metrics_folsom
metrics_noop
metrics_process_tracker
metrics_sup

About

A generic interface to different metrics systems in Erlang.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp