# 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

## Types Aliases

### Sample

using Sample = Poco::Int64;

## Constructors

### IntGauge

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

~IntGauge() = default;

Destroys the IntGauge.

## Member Functions

### dec

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

void exportTo(
Exporter & exporter
) const override;

See also: Poco::Prometheus::Collector::exportTo()

### help

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

Sets the IntGauge's help text.

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

### inc

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

void set(
Sample v
);

Sets the IntGauge's current value.

### setToCurrentTime

void setToCurrentTime();

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

### value

Sample value() const;

Returns the IntGauge's current value.