Skip to content

Latest commit

 

History

History
210 lines (113 loc) · 5.08 KB

metrics.md

File metadata and controls

210 lines (113 loc) · 5.08 KB

Module metrics

Behaviours: application, gen_server.

Data Types


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

metric_name() = list()

probe() = {c, integer()} | timer_start | timer_end | {duration_fun, function()} | value()

value() = any()

Function Index

backend/0retrieve the current backend name.
backend/1set the backend to use.
code_change/3
delete/1delete a metric.
handle_call/3
handle_cast/2
handle_info/2
init/1
new/2 initialise a metric.
start/2
start_link/0
stop/1
terminate/2
update/1increment a counter with 1.
update/2update a metric.
update_or_create/3update a metric and create it if it doesn't exists.

Function Details

backend/0


backend() -> atom()

retrieve the current backend name

backend/1


backend(Mod::atom()) -> ok

set the backend to use

code_change/3

code_change(OldVsn, State, Extra) -> any()

delete/1


delete(Name) -> Result

delete a metric

handle_call/3

handle_call(X1, From, State) -> any()

handle_cast/2

handle_cast(Msg, State) -> any()

handle_info/2

handle_info(Info, State) -> any()

init/1

init(X1) -> any()

new/2


new(Metric, Name) -> Result

initialise a metric

start/2


start(StartType::application:start_type(), StartArgs::any()) -> {ok, pid()}

start_link/0


start_link() -> {ok, pid()}

stop/1


stop(State::atom()) -> ok

terminate/2

terminate(Reason, State) -> any()

update/1


update(Name) -> Result

increment a counter with 1

update/2


update(Name, Probe) -> Result

update a metric

update_or_create/3


update_or_create(Name, Probe, Metric) -> Result

update a metric and create it if it doesn't exists