Brassaia.Metrics
Type agnostics mechanisms to manipulate metrics.
Metrics
defines primitives to handle metrics inside of Brassaia. Its purpose is to decouple the metrics type definition from the data manipulation.
A t
can be modified in different ways, depending on the update_mode
.
update_mode
describes how the data will be handled by the update
function.
It gives the possibility to handle the same metric in different ways.
create ~origin ~name ~initial_state repr
create a new t
.
origin
can be set to give an hint about where the data are gatheredname
is a name to describe this metricsinitial_state
is the first value to store in the metric objectrepr
describes the type representation to allow serialization.val update : 'a t -> 'a update_mode -> unit
update metrics mode
updates the metric by taking in consideration mode
to define how it acts on t
according to their specication.