6#include "prometheus/client_metric.h"
7#include "prometheus/counter.h"
8#include "prometheus/detail/builder.h"
9#include "prometheus/detail/core_export.h"
10#include "prometheus/gauge.h"
11#include "prometheus/metric_type.h"
33 using BucketBoundaries = std::vector<double>;
35 static const MetricType metric_type{MetricType::Histogram};
47 Histogram(
const BucketBoundaries& buckets);
63 const double sum_of_values);
71 const BucketBoundaries bucket_boundaries_;
72 mutable std::mutex mutex_;
73 std::vector<Counter> bucket_counts_;
104PROMETHEUS_CPP_CORE_EXPORT detail::Builder<Histogram> BuildHistogram();
A gauge metric to represent a value that can arbitrarily go up and down.
Definition gauge.h:24
void ObserveMultiple(const std::vector< double > &bucket_increments, const double sum_of_values)
Observe multiple data points.
Definition histogram.cc:43
Histogram(const BucketBoundaries &buckets)
Create a histogram with manually chosen buckets.
Definition histogram.cc:25
void Observe(double value)
Observe the given amount.
Definition histogram.cc:32
ClientMetric Collect() const
Get the current value of the counter.
Definition histogram.cc:59
Definition client_metric.h:12