MySQL 8.0.32
Source Code Documentation
LatchCounter Class Reference

Default latch counter. More...

#include <sync0types.h>

Classes

struct  Count
 The counts we collect for a mutex. More...
 

Public Member Functions

 LatchCounter () 1
 Constructor. More...
 
 ~LatchCounter () 1
 Destructor. More...
 
void reset () 1
 Reset all counters to zero. More...
 
Countsum_register () 1
 
void sum_deregister (Count *count) const 1
 Deregister the count. More...
 
void single_register (Count *count) 1
 Register a single instance counter. More...
 
void single_deregister (Count *count) 1
 Deregister a single instance counter. More...
 
template<typename Callback >
void iterate (Callback &&callback) const 1
 Iterate over the counters. More...
 
void enable () 1
 Disable the monitoring. More...
 
void disable () 1
 Disable the monitoring. More...
 
bool is_enabled () const 1
 

Private Types

typedef OSMutex Mutex
 
typedef std::vector< Count * > Counters
 

Private Member Functions

 LatchCounter (const LatchCounter &)
 
LatchCounteroperator= (const LatchCounter &)
 

Private Attributes

Mutex m_mutex
 Mutex protecting m_counters. More...
 
Counters m_counters
 Counters for the latches. More...
 
bool m_active
 if true then we collect the data More...
 

Detailed Description

Default latch counter.

Member Typedef Documentation

◆ Counters

typedef std::vector<Count *> LatchCounter::Counters
private

◆ Mutex

typedef OSMutex LatchCounter::Mutex
private

Constructor & Destructor Documentation

◆ LatchCounter() [1/2]

LatchCounter::LatchCounter ( )
inline

Constructor.

◆ ~LatchCounter()

LatchCounter::~LatchCounter ( )
inline

Destructor.

◆ LatchCounter() [2/2]

LatchCounter::LatchCounter ( const LatchCounter )
private

Member Function Documentation

◆ disable()

void LatchCounter::disable ( )
inline

Disable the monitoring.

◆ enable()

void LatchCounter::enable ( )
inline

Disable the monitoring.

◆ is_enabled()

bool LatchCounter::is_enabled ( ) const
inline
Returns
if monitoring is active

◆ iterate()

template<typename Callback >
void LatchCounter::iterate ( Callback &&  callback) const
inline

Iterate over the counters.

◆ operator=()

LatchCounter & LatchCounter::operator= ( const LatchCounter )
private

◆ reset()

void LatchCounter::reset ( void  )
inline

Reset all counters to zero.

It is not protected by any mutex and we don't care about atomicity. Unless it is a demonstrated problem. The information collected is not required for the correct functioning of the server.

◆ single_deregister()

void LatchCounter::single_deregister ( Count count)
inline

Deregister a single instance counter.

Parameters
[in]countThe count instance to deregister

◆ single_register()

void LatchCounter::single_register ( Count count)
inline

Register a single instance counter.

◆ sum_deregister()

void LatchCounter::sum_deregister ( Count count) const
inline

Deregister the count.

We don't do anything

Parameters
[in]countThe count instance to deregister

◆ sum_register()

Count * LatchCounter::sum_register ( )
inline
Returns
the aggregate counter

Member Data Documentation

◆ m_active

bool LatchCounter::m_active
private

if true then we collect the data

◆ m_counters

Counters LatchCounter::m_counters
private

Counters for the latches.

◆ m_mutex

Mutex LatchCounter::m_mutex
mutableprivate

Mutex protecting m_counters.


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