CollectorRegistry

This class provides methods to collect metrics with no label, one label, or multiple labels, using overloaded definitions of the collect method.

Once the desired stats have been collected, the accumulated response string can be collected using the getCollection method.

Additionally, the reset method can be used to reset stat collection, when the desired stats have been collected from a Collector instance.

Constructors

this
this(CollectionDg[] callbacks)

Constructor, that accepts an array of stat collection callbacks.

Members

Aliases

CollectionDg
alias CollectionDg = void delegate(Collector)

An alias for the type of delegates that are called for stat collection

Functions

addCollector
void addCollector(CollectionDg collector)

Appends a stat collector callback to the list of existing ones. May result in a re-allocation of the entire buffer storing the callbacks.

collect
cstring collect()

Collects stats by calling all delegates specified for stat collection, formats them using ocean.util.prometheus.collector.StatFormatter eventually, and finally returns the accumulated result. The specifications of the format can be found at https://prometheus.io/docs/instrumenting/exposition_formats/.

Meta