prom 0.1.0
Client-independent C++23 Prometheus/OpenMetrics metric abstraction
Loading...
Searching...
No Matches
Public Member Functions | List of all members
prom::Summary Class Reference

A summary. Like a histogram but tracks quantiles instead of fixed buckets. More...

#include <summary.hpp>

Inheritance diagram for prom::Summary:
Inheritance graph
[legend]
Collaboration diagram for prom::Summary:
Collaboration graph
[legend]

Public Member Functions

 Summary (const std::string_view name, const std::string_view help)
 
 Summary (const SummarySpec &spec)
 
 Summary (std::shared_ptr< MetricCore > core)
 
template<class T >
requires std::is_arithmetic_v<T>
void observe (T value) noexcept
 Observe a raw value.
 
template<DimensionalValue V>
void observe (const V &value) noexcept
 Observe a dimensional value.
 
Summary labels (const Labels &dynamic) const noexcept
 
- Public Member Functions inherited from prom::MetricBase< Summary >
std::string_view name () const noexcept
 The metric's fully-qualified name.
 
MetricType type () const noexcept
 The metric kind.
 

Additional Inherited Members

- Protected Member Functions inherited from prom::MetricBase< Summary >
 MetricBase (const MetricType type, const std::string_view name, const std::string_view help)
 Standalone, unbound construction from a name and help string.
 
 MetricBase (std::shared_ptr< MetricCore > core)
 Adopt an already-populated core (registered metrics and children).
 
 MetricBase (const MetricBase &)=default
 
 MetricBase (MetricBase &&)=default
 
MetricBaseoperator= (const MetricBase &)=default
 
MetricBaseoperator= (MetricBase &&)=default
 
 ~MetricBase ()=default
 
Binding bind () const noexcept
 Resolve the adapter and backend handle this metric should record against.
 
const std::shared_ptr< MetricCore > & core () const noexcept
 
Summary make_child (const Labels &dynamic) const noexcept
 Resolve a labeled child of the same metric type.
 
bool reconcile_unit (const Unit &observed, Adapter &adapter) const noexcept
 Reconcile an observed unit against the family's known unit.
 
bool check_finite (const double value, std::string_view op) const noexcept
 Drop-and-log guard for a non-finite sample.
 
- Static Protected Member Functions inherited from prom::MetricBase< Summary >
static spdlog::logger * logger () noexcept
 The shared per-process metrics logger.
 
- Protected Attributes inherited from prom::MetricBase< Summary >
std::shared_ptr< MetricCorecore_
 

Detailed Description

A summary. Like a histogram but tracks quantiles instead of fixed buckets.

Constructor & Destructor Documentation

◆ Summary() [1/3]

prom::Summary::Summary ( const std::string_view  name,
const std::string_view  help 
)
inline

◆ Summary() [2/3]

prom::Summary::Summary ( const SummarySpec spec)
inlineexplicit

◆ Summary() [3/3]

prom::Summary::Summary ( std::shared_ptr< MetricCore core)
inlineexplicit

Member Function Documentation

◆ labels()

Summary prom::Summary::labels ( const Labels dynamic) const
inlinenoexcept

◆ observe() [1/2]

template<DimensionalValue V>
void prom::Summary::observe ( const V &  value)
inlinenoexcept

Observe a dimensional value.

◆ observe() [2/2]

template<class T >
requires std::is_arithmetic_v<T>
void prom::Summary::observe ( value)
inlinenoexcept

Observe a raw value.


The documentation for this class was generated from the following file: