Coder Social home page Coder Social logo

erlang-metrics's Introduction

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

erlang-metrics's People

Contributors

benoitc avatar glejeune avatar okeuday avatar puzza007 avatar voughtdq avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.