iceberg-cpp
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
iceberg::MetricsContext Class Referenceabstract

Factory for creating named Counter and Timer instances. More...

#include <metrics_context.h>

Inheritance diagram for iceberg::MetricsContext:
iceberg::DefaultMetricsContext

Public Member Functions

virtual std::shared_ptr< CounterGetCounter (std::string_view name, CounterUnit unit)=0
 Get or create a named Counter with an explicit unit.
 
std::shared_ptr< CounterGetCounter (std::string_view name)
 Get or create a count-unit Counter by name.
 
virtual std::shared_ptr< TimerGetTimer (std::string_view name, TimerUnit unit)=0
 Get or create a named Timer with an explicit unit.
 
std::shared_ptr< TimerGetTimer (std::string_view name)
 Get or create a nanosecond-precision Timer by name.
 

Static Public Member Functions

static const std::shared_ptr< MetricsContext > & Noop ()
 Return the no-op MetricsContext singleton.
 
static std::unique_ptr< MetricsContextDefault ()
 Create a new DefaultMetricsContext.
 

Detailed Description

Factory for creating named Counter and Timer instances.

Member Function Documentation

◆ GetCounter() [1/2]

std::shared_ptr< Counter > iceberg::MetricsContext::GetCounter ( std::string_view  name)
inline

Get or create a count-unit Counter by name.

Convenience overload defaulting to CounterUnit::kCount.

◆ GetCounter() [2/2]

virtual std::shared_ptr< Counter > iceberg::MetricsContext::GetCounter ( std::string_view  name,
CounterUnit  unit 
)
pure virtual

Get or create a named Counter with an explicit unit.

Implemented in iceberg::DefaultMetricsContext, and iceberg::DefaultMetricsContext.

◆ GetTimer() [1/2]

std::shared_ptr< Timer > iceberg::MetricsContext::GetTimer ( std::string_view  name)
inline

Get or create a nanosecond-precision Timer by name.

Convenience overload defaulting to TimerUnit::kNanoseconds.

◆ GetTimer() [2/2]

virtual std::shared_ptr< Timer > iceberg::MetricsContext::GetTimer ( std::string_view  name,
TimerUnit  unit 
)
pure virtual

Get or create a named Timer with an explicit unit.

Implemented in iceberg::DefaultMetricsContext, and iceberg::DefaultMetricsContext.

◆ Noop()

const std::shared_ptr< MetricsContext > & iceberg::MetricsContext::Noop ( )
static

Return the no-op MetricsContext singleton.

All metrics returned by the no-op context are noop; nothing is allocated.


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