Module eradius_counter

This module implements the statitics counter for RADIUS servers and clients.

Behaviours: gen_server.

Description

This module implements the statitics counter for RADIUS servers and clients

Data Types

nas_counters()

nas_counters() = {erlang:timestamp(), [#nas_counter{}]}

srv_counters()

srv_counters() = [#server_counter{}]

stats()

stats() = {srv_counters(), nas_counters()}

Function Index

aggregate/1calculate the per server sum of all counters of a per NAS list of counters.
dec_counter/2
inc_counter/2increment a specific counter value.
inc_reply_counter/2increment reply counters.
inc_request_counter/2increment requests counters.
init_counter/1initialize a counter structure.
init_counter/2
observe/4Update the given histogram metric value NOTE: We use prometheus_histogram collector here instead of eradius_counter ets table because it is much easy to use histograms in this way.
observe/5
pull/0read counters and reset to zero.
read/0read counters.
reset/0reset all counters to zero.
reset_counter/1reset counters.
reset_counter/2
set_boolean_metric/3Set Value for the given prometheus boolean metric by the given Name with the given values.

Function Details

aggregate/1

aggregate(X1::stats()) -> stats()

calculate the per server sum of all counters of a per NAS list of counters

dec_counter/2

dec_counter(Counter, Nas) -> any()

inc_counter/2

inc_counter(Counter, Counters) -> any()

increment a specific counter value

inc_reply_counter/2

inc_reply_counter(Counter, Nas) -> any()

increment reply counters

inc_request_counter/2

inc_request_counter(Counter, Nas) -> any()

increment requests counters

init_counter/1

init_counter(X1) -> any()

initialize a counter structure

init_counter/2

init_counter(Nas_prop, ServerName) -> any()

observe/4

observe(Name, MetricsInfo, Value, Help) -> any()

Update the given histogram metric value NOTE: We use prometheus_histogram collector here instead of eradius_counter ets table because it is much easy to use histograms in this way. As we don't need to manage buckets and do the other histogram things in eradius, but prometheus.erl will do it for us

observe/5

observe(Name, Nas_prop, Value, ServerName, Help) -> any()

pull/0

pull() -> stats()

read counters and reset to zero

read/0

read() -> stats()

read counters

reset/0

reset() -> any()

reset all counters to zero

reset_counter/1

reset_counter(Server_counter) -> any()

reset counters

reset_counter/2

reset_counter(Nas, ServerName) -> any()

set_boolean_metric/3

set_boolean_metric(Name, Labels, Value) -> any()

Set Value for the given prometheus boolean metric by the given Name with the given values


Generated by EDoc