Loading...
Searching...
No Matches
counter.h
#pragma once
#include "prometheus/client_metric.h"
#include "prometheus/detail/builder.h" // IWYU pragma: export
#include "prometheus/detail/core_export.h"
#include "prometheus/gauge.h"
#include "prometheus/metric_type.h"
namespace prometheus {
class PROMETHEUS_CPP_CORE_EXPORT Counter {
public:
static const MetricType metric_type{MetricType::Counter};
Counter() = default;
void Increment();
void Increment(double);
double Value() const;
ClientMetric Collect() const;
private:
Gauge gauge_{0.0};
};
PROMETHEUS_CPP_CORE_EXPORT detail::Builder<Counter> BuildCounter();
} // namespace prometheus
prometheus::Counter
A counter metric to represent a monotonically increasing value.
Definition counter.h:26
prometheus::Counter::Counter
Counter()=default
Create a counter that starts at 0.
prometheus::Gauge
A gauge metric to represent a value that can arbitrarily go up and down.
Definition gauge.h:24
prometheus::ClientMetric
Definition client_metric.h:12