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

Shared, reference-counted state behind every metric handle. More...

#include <metric_base.hpp>

Collaboration diagram for prom::MetricCore:
Collaboration graph
[legend]

Classes

struct  Bound
 

Public Member Functions

Unit unit_view () const
 Build a non-owning view of the currently-known unit.
 
MetricMeta build_meta () const
 Assemble the transient registration metadata.
 

Public Attributes

MetricType type {}
 
std::string name
 
std::string help
 
Labels const_labels
 
comms::DisplayInfo display
 
std::vector< double > buckets
 
std::vector< double > quantiles
 
std::vector< std::string > states
 
std::shared_ptr< AdapterSourcesource
 
detail::AtomicSharedPtr< Boundbound
 
bool pinned = false
 
std::shared_ptr< ScopeStatescope
 
std::string base_name
 
Labels base_labels
 
comms::DisplayInfo base_display
 
std::mutex bind_mutex
 
std::shared_ptr< MetricCorefamily
 
std::mutex unit_mutex
 
bool has_unit = false
 
bool unit_from_dimval = false
 
std::string unit_name
 
std::string unit_kind
 
std::string unit_symbol
 

Detailed Description

Shared, reference-counted state behind every metric handle.

It owns the stable string/buffer storage that MetricMeta views into, the adapter source it reads its backend from, the currently-published binding, and the bookkeeping for lazy/live binding and runtime unit reconciliation.

Member Function Documentation

◆ build_meta()

MetricMeta prom::MetricCore::build_meta ( ) const
inline

Assemble the transient registration metadata.

The returned views/spans are valid only while *this outlives the call (always true: the caller holds the core).

◆ unit_view()

Unit prom::MetricCore::unit_view ( ) const
inline

Build a non-owning view of the currently-known unit.

Member Data Documentation

◆ base_display

comms::DisplayInfo prom::MetricCore::base_display

◆ base_labels

Labels prom::MetricCore::base_labels

◆ base_name

std::string prom::MetricCore::base_name

◆ bind_mutex

std::mutex prom::MetricCore::bind_mutex

◆ bound

detail::AtomicSharedPtr<Bound> prom::MetricCore::bound

◆ buckets

std::vector<double> prom::MetricCore::buckets

◆ const_labels

Labels prom::MetricCore::const_labels

◆ display

comms::DisplayInfo prom::MetricCore::display

◆ family

std::shared_ptr<MetricCore> prom::MetricCore::family

◆ has_unit

bool prom::MetricCore::has_unit = false

◆ help

std::string prom::MetricCore::help

◆ name

std::string prom::MetricCore::name

◆ pinned

bool prom::MetricCore::pinned = false

◆ quantiles

std::vector<double> prom::MetricCore::quantiles

◆ scope

std::shared_ptr<ScopeState> prom::MetricCore::scope

◆ source

std::shared_ptr<AdapterSource> prom::MetricCore::source

◆ states

std::vector<std::string> prom::MetricCore::states

◆ type

MetricType prom::MetricCore::type {}

◆ unit_from_dimval

bool prom::MetricCore::unit_from_dimval = false

◆ unit_kind

std::string prom::MetricCore::unit_kind

◆ unit_mutex

std::mutex prom::MetricCore::unit_mutex

◆ unit_name

std::string prom::MetricCore::unit_name

◆ unit_symbol

std::string prom::MetricCore::unit_symbol

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