|
prom 0.1.0
Client-independent C++23 Prometheus/OpenMetrics metric abstraction
|
The source a metric reads its current adapter from, decoupled from Registry so that metric_base can resolve a binding without depending on the registry layer (which would be an include cycle), mirroring ScopeState.
More...
#include <adapter.hpp>

Public Member Functions | |
| AdapterSource ()=default | |
| AdapterSource (const AdapterSource &)=delete | |
| AdapterSource & | operator= (const AdapterSource &)=delete |
| AdapterSource (AdapterSource &&)=delete | |
| AdapterSource & | operator= (AdapterSource &&)=delete |
| virtual | ~AdapterSource ()=default |
| virtual std::uint64_t | version () const noexcept=0 |
| Monotonic counter, bumped on every adapter swap. | |
| virtual AdapterPtr | adapter () const =0 |
| The current adapter, never null. | |
The source a metric reads its current adapter from, decoupled from Registry so that metric_base can resolve a binding without depending on the registry layer (which would be an include cycle), mirroring ScopeState.
Every MetricCore holds a shared_ptr<AdapterSource> — the AdapterCell of the Registry that created it, or the process-wide global cell for standalone and scoped metrics. version() advances whenever the adapter is swapped, which is how an already-created metric notices it must re-register against the new backend on its next use (live migration).
|
default |
|
delete |
|
delete |
|
virtualdefault |
|
pure virtual |
The current adapter, never null.
Returns a shared_ptr copy so a concurrent swap cannot invalidate the adapter an in-flight caller uses.
Implemented in prom::AdapterCell.
|
delete |
|
delete |
|
pure virtualnoexcept |
Monotonic counter, bumped on every adapter swap.
Implemented in prom::AdapterCell.