Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Metrics for erlang

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 priv
Octocat-spinner-32 src
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 rebar
README.md

Metrics

Counters for erlang apps.

Two basics tools to get numbers from your application :

Counter

How many time this action happens?

application:start(metrics),
metrics_counter:incr(my_counter, 2),

Gauge

Collect score for mean, min/max and other statistic later

application:start(metrics),
metrics_gauge:append(my_gauge, 42),

There is an helper for managing timer :

application:start(metrics),
Start = now(),
% do something here
metrics_gauge:append_timer(my_timer, Start),

Writing datas

metrics can use a writer to store datas. Writer implements the behaviour metrics_writer.

CSV

application:start(metrics),
%driver, frequency (ms), arguments
metrics:add_writer(metrics_csv, 10000, ["/tmp/my_folder"]),
metrics_counter:incr("potatoe"),

A cli tools is provided to compile datas

./priv/bin/metrics_graph

The future

Storing value in collectd, graphite or plain old file.

Something went wrong with that request. Please try again.