Poco::Prometheus

class IntGauge

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

Description

IntGauge is a very low overhead implementation of a Gauge, supporting 64-bit integer values only, using std::atomic.

Labels are not supported.

Inheritance

Direct Base Classes: Metric

All Base Classes: Collector, Metric

Member Summary

Member Functions: dec, exportTo, help, inc, set, setToCurrentTime, value

Inherited Functions: exportTo, help, name, setHelp, type, validateName

Nested Classes

struct Params

 more...

Types Aliases

Sample

using Sample = Poco::Int64;

Constructors

IntGauge inline

explicit IntGauge(
    const std::string & name
);

Creates a IntGauge with the given name and registers it with the default registry.

IntGauge

IntGauge(
    const std::string & name,
    const Params & params
);

Creates a IntGauge with the given name and help text (via params), and registers it with the default registry.

IntGauge

IntGauge(
    const std::string & name,
    Registry * pRegistry
);

Creates a IntGauge with the given name and registers it with the given registry (if not nullptr).

IntGauge

IntGauge(
    const std::string & name,
    const Params & params,
    Registry * pRegistry
);

Creates a IntGauge with the given name and help text (via params), and registers it with the given registry (if not nullptr).

Destructor

~IntGauge virtual

~IntGauge() = default;

Destroys the IntGauge.

Member Functions

dec inline

void dec();

Decrements the IntGauge's current value by one.

dec

void dec(
    Sample v
);

Increments the IntGauge's current value by the given value.

exportTo virtual

void exportTo(
    Exporter & exporter
) const override;

help inline

IntGauge & help(
    const std::string & text
);

Sets the IntGauge's help text.

Must only be set once, immediately after creating the IntGauge.

inc inline

void inc();

Increments the IntGauge's current value by one.

inc

void inc(
    Sample v
);

Increments the IntGauge's current value by the given value.

set inline

void set(
    Sample v
);

Sets the IntGauge's current value.

setToCurrentTime inline

void setToCurrentTime();

Sets the Gauge's current value to the current epoch time (seconds since midnight January 1st 1970).

value inline

Sample value() const;

Returns the IntGauge's current value.