40 virtual std::shared_ptr<Counter>
GetCounter(std::string_view name,
46 std::shared_ptr<Counter>
GetCounter(std::string_view name) {
47 return GetCounter(name, CounterUnit::kCount);
56 std::shared_ptr<Timer>
GetTimer(std::string_view name) {
57 return GetTimer(name, TimerUnit::kNanoseconds);
63 static const std::shared_ptr<MetricsContext>&
Noop();
66 static std::unique_ptr<MetricsContext>
Default();
72 using MetricsContext::GetCounter;
73 using MetricsContext::GetTimer;
MetricsContext backed by DefaultCounter and DefaultTimer instances.
Definition metrics_context.h:70
std::shared_ptr< Timer > GetTimer(std::string_view name, TimerUnit unit) override
Get or create a named Timer with an explicit unit.
std::shared_ptr< Counter > GetCounter(std::string_view name, CounterUnit unit) override
Get or create a named Counter with an explicit unit.
Factory for creating named Counter and Timer instances.
Definition metrics_context.h:35
virtual std::shared_ptr< Counter > GetCounter(std::string_view name, CounterUnit unit)=0
Get or create a named Counter with an explicit unit.
static const std::shared_ptr< MetricsContext > & Noop()
Return the no-op MetricsContext singleton.
static std::unique_ptr< MetricsContext > Default()
Create a new DefaultMetricsContext.
virtual std::shared_ptr< Timer > GetTimer(std::string_view name, TimerUnit unit)=0
Get or create a named Timer with an explicit unit.
std::shared_ptr< Timer > GetTimer(std::string_view name)
Get or create a nanosecond-precision Timer by name.
Definition metrics_context.h:56
std::shared_ptr< Counter > GetCounter(std::string_view name)
Get or create a count-unit Counter by name.
Definition metrics_context.h:46
Define symbol visibility macros for core Iceberg APIs.
Core Apache Iceberg C++ APIs.
Definition arrow_io_util.h:33
TimerUnit
Time units supported by Timer.
Definition timer.h:39
CounterUnit
Unit for a Counter metric.
Definition counter.h:38