MySQL 9.2.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
Time_based_metric_interface Class Referenceabstract

Abstract class for time based metrics implementations. More...

#include <time_based_metric_interface.h>

Inheritance diagram for Time_based_metric_interface:
[legend]

Public Member Functions

virtual ~Time_based_metric_interface ()=default
 
virtual void reset ()=0
 Resets the counter and time to 0. More...
 
virtual int64_t get_time () const =0
 Returns the total time waited across all executions of the start/stop methods, minus the absolute start time of the last one in case it has not ended. More...
 
virtual void increment_counter ()=0
 Increment the counter. More...
 
virtual int64_t get_count () const =0
 Returns the number of times we waited on give spot. More...
 
auto time_scope ()
 Start the timer, and return an object that will stop the timer when it is deleted. More...
 

Protected Member Functions

virtual void start_timer ()=0
 Starts the timer. More...
 
virtual void stop_timer ()=0
 Stops the timer. More...
 

Detailed Description

Abstract class for time based metrics implementations.

Constructor & Destructor Documentation

◆ ~Time_based_metric_interface()

virtual Time_based_metric_interface::~Time_based_metric_interface ( )
virtualdefault

Member Function Documentation

◆ get_count()

virtual int64_t Time_based_metric_interface::get_count ( ) const
pure virtual

Returns the number of times we waited on give spot.

Returns
the number of times waited

Implemented in Time_based_metric, and Time_based_metric_stub.

◆ get_time()

virtual int64_t Time_based_metric_interface::get_time ( ) const
pure virtual

Returns the total time waited across all executions of the start/stop methods, minus the absolute start time of the last one in case it has not ended.

Returns
The total time waited, in nanoseconds.

Implemented in Time_based_metric, and Time_based_metric_stub.

◆ increment_counter()

virtual void Time_based_metric_interface::increment_counter ( )
pure virtual

Increment the counter.

Note
The counter is normally incremented automatically each time time_scope is called. This function is needed only for objects where that functionality has been disabled.

Implemented in Time_based_metric, and Time_based_metric_stub.

◆ reset()

virtual void Time_based_metric_interface::reset ( )
pure virtual

Resets the counter and time to 0.

Implemented in Time_based_metric, and Time_based_metric_stub.

◆ start_timer()

virtual void Time_based_metric_interface::start_timer ( )
protectedpure virtual

Starts the timer.

Used internally; the public interface is time_scope().

Implemented in Time_based_metric, and Time_based_metric_stub.

◆ stop_timer()

virtual void Time_based_metric_interface::stop_timer ( )
protectedpure virtual

Stops the timer.

Used internally; the public interface is time_scope().

Implemented in Time_based_metric, and Time_based_metric_stub.

◆ time_scope()

auto Time_based_metric_interface::time_scope ( )
inline

Start the timer, and return an object that will stop the timer when it is deleted.


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