24#ifndef CHANGESTREAMS_APPLY_METRICS_TIME_BASED_METRIC_INTERFACE_H
25#define CHANGESTREAMS_APPLY_METRICS_TIME_BASED_METRIC_INTERFACE_H
Abstract class for time based metrics implementations.
Definition: time_based_metric_interface.h:32
virtual void stop_timer()=0
Stops the timer.
virtual ~Time_based_metric_interface()=default
virtual int64_t get_count() const =0
Returns the number of times we waited on give spot.
virtual void reset()=0
Resets the counter and time to 0.
virtual void start_timer()=0
Starts the timer.
virtual void increment_counter()=0
Increment the counter.
auto time_scope()
Start the timer, and return an object that will stop the timer when it is deleted.
Definition: time_based_metric_interface.h:58
virtual int64_t get_time() const =0
Returns the total time waited across all executions of the start/stop methods, minus the absolute sta...
#define NODISCARD
The function attribute [[NODISCARD]] is a replacement for [[nodiscard]] to workaround a gcc bug.
Definition: nodiscard.h:47
Scope_guard< TLambda > create_scope_guard(const TLambda rollback_lambda)
Create a scope guard object.
Definition: scope_guard.h:113