Module metrics

Data Types

metric()

metric() = counter | histogram | gauge | meter | spiral

metrics_engine()

metrics_engine() = #metrics_ng{}

Function Index

decrement_counter/2decrement a counter with 1.
decrement_counter/3decrement a counter with value.
decrement_spiral/2decrement a spiral with 1.
decrement_spiral/3decrement a spiral with value.
delete/2delete a metric.
get_value/2Fetch the current value of the metric.
increment_counter/2increment a counter with 1.
increment_counter/3increment a counter with Value.
increment_spiral/2increment a spiral with 1.
increment_spiral/3increment a spiral with Value.
init/1set the module to use for metrics.
new/3create a new metric.
sample/2Tells the metric to take a sample.
update_gauge/3update a gauge with a value.
update_histogram/3update an histogram with a value or the duration of a function.
update_meter/3update a meter with a valyue.

Function Details

decrement_counter/2

decrement_counter(Metrics_ng::metrics_engine(), Name::any()) -> ok | {error, term()}

decrement a counter with 1

decrement_counter/3

decrement_counter(Metrics_ng::metrics_engine(), Name::any(), Value::pos_integer()) -> ok | {error, term()}

decrement a counter with value

decrement_spiral/2

decrement_spiral(Metrics_ng::metrics_engine(), Name::any()) -> ok | {error, term()}

decrement a spiral with 1

decrement_spiral/3

decrement_spiral(Metrics_ng::metrics_engine(), Name::any(), Value::pos_integer()) -> ok | {error, term()}

decrement a spiral with value

delete/2

delete(Metrics_ng::metrics_engine(), Name::any()) -> ok

delete a metric

get_value/2

get_value(Metrics_ng::metrics_engine(), Name::any()) -> term() | {error, term()}

Fetch the current value of the metric.

increment_counter/2

increment_counter(Metrics_ng::metrics_engine(), Name::any()) -> ok | {error, term()}

increment a counter with 1

increment_counter/3

increment_counter(Metrics_ng::metrics_engine(), Name::any(), Value::pos_integer()) -> ok | {error, term()}

increment a counter with Value

increment_spiral/2

increment_spiral(Metrics_ng::metrics_engine(), Name::any()) -> ok | {error, term()}

increment a spiral with 1

increment_spiral/3

increment_spiral(Metrics_ng::metrics_engine(), Name::any(), Value::pos_integer()) -> ok | {error, term()}

increment a spiral with Value

init/1

init(Mod::atom()) -> metrics_engine()

set the module to use for metrics. Types are: counter, histograme, gauge, meter

modules supported are:

new/3

new(Metrics_ng::metrics_engine(), Type::metric(), Name::any()) -> ok | {error, term()}

create a new metric

sample/2

sample(Metrics_ng::metrics_engine(), Name::any()) -> ok | unsupported | list() | {error, term()}

Tells the metric to take a sample.

update_gauge/3

update_gauge(Metrics_ng::metrics_engine(), Name::any(), Value::number()) -> ok | {error, term()}

update a gauge with a value

update_histogram/3

update_histogram(Metrics_ng::metrics_engine(), Name::any(), ValueOrFun::number()) -> ok | {error, term()}

update_histogram(Metrics_ng::metrics_engine(), Name::any(), ValueOrFun::function()) -> ok | {error, term()}

update an histogram with a value or the duration of a function. When passing a function the result will be returned once the metric have been updated with the duration.

update_meter/3

update_meter(Metrics_ng::metrics_engine(), Name::any(), Value::number()) -> ok | {error, term()}

update a meter with a valyue


Generated by EDoc