Struct Stats

Base stats class that helps define other stats classes.class Usage is Stats!(ConcreateStatsValue, ConcreateStatsLabel) concreate_stats;

struct Stats(ValueType, LabelType) ;

Fields

NameTypeDescription
SEPARATOR voidSeparator used by Prometheus
stats_maps ValueType[string]Contains the stats

Methods

NameDescription
clear () Clears stats
getStats () Function that prepares and returns the metrics with the corresponding labels
increaseMetricBy (amount, labels_packed) Increases the metric's value by some amount and attach some labels to it
setMetricTo (amount, labels_packed) Sets the metric's value to some amount and attach some labels to it

Inner structs

NameDescription
StatValueLabel

Aliases

NameDescription
LabelTypeT
ValueTypeT

Parameters

NameDescription
ValueType fields of this struct will correspond to metric names
LabelType fields of this struct will correspond to label names