Storage Engine API
mongo::LockStats< CounterType > Class Template Reference

Templatized lock statistics management class, which can be specialized with atomic integers for the global stats and with regular integers for the per-locker stats. More...

#include <lock_stats.h>

Detailed Description

template<typename CounterType>
class mongo::LockStats< CounterType >

Templatized lock statistics management class, which can be specialized with atomic integers for the global stats and with regular integers for the per-locker stats.

Classes

struct  PerModeLockStatCounters
 

Public Types

typedef LockStatCounters< CounterType > LockStatCountersType
 

Public Member Functions

 LockStats ()
 Initializes the locking statistics with zeroes (calls reset). More...
 
void recordAcquisition (ResourceId resId, LockMode mode)
 
void recordWait (ResourceId resId, LockMode mode)
 
void recordWaitTime (ResourceId resId, LockMode mode, int64_t waitMicros)
 
void recordDeadlock (ResourceId resId, LockMode mode)
 
LockStatCountersTypeget (ResourceId resId, LockMode mode)
 
template<typename OtherType >
void append (const LockStats< OtherType > &other)
 
void report (BSONObjBuilder *builder) const
 
void reset ()
 

Private Member Functions

void _report (BSONObjBuilder *builder, const char *sectionName, const PerModeLockStatCounters &stat) const
 

Private Attributes

PerModeLockStatCounters _stats [ResourceTypesCount]
 
PerModeLockStatCounters _oplogStats
 

Friends

template<typename T >
class LockStats
 

Member Typedef Documentation

◆ LockStatCountersType

template<typename CounterType>
typedef LockStatCounters<CounterType> mongo::LockStats< CounterType >::LockStatCountersType

Constructor & Destructor Documentation

◆ LockStats()

template<typename CounterType >
mongo::LockStats< CounterType >::LockStats ( )

Initializes the locking statistics with zeroes (calls reset).

Member Function Documentation

◆ _report()

template<typename CounterType >
void mongo::LockStats< CounterType >::_report ( BSONObjBuilder *  builder,
const char *  sectionName,
const PerModeLockStatCounters stat 
) const
private

◆ append()

template<typename CounterType>
template<typename OtherType >
void mongo::LockStats< CounterType >::append ( const LockStats< OtherType > &  other)
inline

◆ get()

template<typename CounterType>
LockStatCountersType& mongo::LockStats< CounterType >::get ( ResourceId  resId,
LockMode  mode 
)
inline

◆ recordAcquisition()

template<typename CounterType>
void mongo::LockStats< CounterType >::recordAcquisition ( ResourceId  resId,
LockMode  mode 
)
inline

◆ recordDeadlock()

template<typename CounterType>
void mongo::LockStats< CounterType >::recordDeadlock ( ResourceId  resId,
LockMode  mode 
)
inline

◆ recordWait()

template<typename CounterType>
void mongo::LockStats< CounterType >::recordWait ( ResourceId  resId,
LockMode  mode 
)
inline

◆ recordWaitTime()

template<typename CounterType>
void mongo::LockStats< CounterType >::recordWaitTime ( ResourceId  resId,
LockMode  mode,
int64_t  waitMicros 
)
inline

◆ report()

template<typename CounterType >
void mongo::LockStats< CounterType >::report ( BSONObjBuilder *  builder) const

◆ reset()

template<typename CounterType >
void mongo::LockStats< CounterType >::reset ( )

Friends And Related Function Documentation

◆ LockStats

template<typename CounterType>
template<typename T >
friend class LockStats
friend

Member Data Documentation

◆ _oplogStats

template<typename CounterType>
PerModeLockStatCounters mongo::LockStats< CounterType >::_oplogStats
private

◆ _stats

template<typename CounterType>
PerModeLockStatCounters mongo::LockStats< CounterType >::_stats[ResourceTypesCount]
private

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