Poco::Prometheus

class Metric

Library: Prometheus
Package: Core
Header: Poco/Prometheus/Metric.h

Description

This is the base class for all metrics, such as Counter, Gauge and Histogram.

Inheritance

Direct Base Classes: Collector

All Base Classes: Collector

Known Derived Classes: IntGauge, CallbackMetric, LabeledMetric, IntCounter, LabeledMetricImpl

Member Summary

Member Functions: help, setHelp, type

Inherited Functions: exportTo, name, validateName

Enumerations

Type

COUNTER

GAUGE

HISTOGRAM

SUMMARY

UNTYPED

Constructors

Metric protected inline

Metric(
    Type type,
    const std::string & name
);

Creates a Metric with the given type and name, and registers it with the default Registry.

The name must be a valid metric name and match the regular expression [a-zA-Z_:][a-zA-Z0-9_:]*.

Metric protected

Metric(
    Type type,
    const std::string & name,
    Registry * pRegistry
);

Creates a Metric with the given type and name, and registers it with the given Registry (if not nullptr).

The name must be a valid metric name and match the regular expression [a-zA-Z_:][a-zA-Z0-9_:]*.

Destructor

~Metric virtual

~Metric() = default;

Destroys the Metric.

Member Functions

help inline

const std::string & help() const;

Returns the metric's help text.

type inline

Type type() const;

Returns the metric's type.

setHelp protected inline

void setHelp(
    const std::string & help
);

Sets the metric's help text.