Net::Prometheus::Registry3pm
A collection of metrics collectors
Overview
This class, or instances of it, acts as a simple storage array for instances derived from Net::Prometheus::Metric, known as "collectors".
A single global collection is stored by the module, accessible via the class methods. Additional collections may be made with the constructor and then accessed by instance methods.
Constructor
new
$registry = Net::Prometheus::Registry->new;
Returns a new registry instance.
Methods
register
$collector = Net::Prometheus::Registry->register( $collector );$collector = $registry->register( $collector );
Adds a new collector to the registry. The collector instance itself is returned, for convenience of chaining method calls on it.
unregister
Net::Prometheus::Registry->unregister( $collector );$registry->unregister( $collector );
Removes a previously-registered collector.
collectors
@collectors = Net::Prometheus::Registry->collectors;@collectors = $registry->collectors;
Returns a list of the currently-registered collectors.
Releases
3 releases since Debian 11 (Bullseye); the text changed 2 times.