@ -3,13 +3,14 @@
// LICENSE file in the root directory of this source tree. An additional grant
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
// of patent rights can be found in the PATENTS file in the same directory.
# include "util/perf_context_imp.h"
# include "util/instrumented_mutex.h"
# include "util/instrumented_mutex.h"
# include "util/perf_context_imp.h"
# include "util/thread_status_util.h"
# include "util/thread_status_util.h"
namespace rocksdb {
namespace rocksdb {
void InstrumentedMutex : : Lock ( ) {
void InstrumentedMutex : : Lock ( ) {
PERF_TIMER_GUARD ( db_mutex_lock_nanos ) ;
PERF_CONDITIONAL_TIMER_GUARD ( db_mutex_lock_nanos ,
stats_code_ = = DB_MUTEX_WAIT_MICROS ) ;
uint64_t wait_time_micros = 0 ;
uint64_t wait_time_micros = 0 ;
if ( env_ ! = nullptr & & stats_ ! = nullptr ) {
if ( env_ ! = nullptr & & stats_ ! = nullptr ) {
{
{
@ -30,7 +31,8 @@ void InstrumentedMutex::LockInternal() {
}
}
void InstrumentedCondVar : : Wait ( ) {
void InstrumentedCondVar : : Wait ( ) {
PERF_TIMER_GUARD ( db_condition_wait_nanos ) ;
PERF_CONDITIONAL_TIMER_GUARD ( db_condition_wait_nanos ,
stats_code_ = = DB_MUTEX_WAIT_MICROS ) ;
uint64_t wait_time_micros = 0 ;
uint64_t wait_time_micros = 0 ;
if ( env_ ! = nullptr & & stats_ ! = nullptr ) {
if ( env_ ! = nullptr & & stats_ ! = nullptr ) {
{
{
@ -51,7 +53,8 @@ void InstrumentedCondVar::WaitInternal() {
}
}
bool InstrumentedCondVar : : TimedWait ( uint64_t abs_time_us ) {
bool InstrumentedCondVar : : TimedWait ( uint64_t abs_time_us ) {
PERF_TIMER_GUARD ( db_condition_wait_nanos ) ;
PERF_CONDITIONAL_TIMER_GUARD ( db_condition_wait_nanos ,
stats_code_ = = DB_MUTEX_WAIT_MICROS ) ;
uint64_t wait_time_micros = 0 ;
uint64_t wait_time_micros = 0 ;
bool result = false ;
bool result = false ;
if ( env_ ! = nullptr & & stats_ ! = nullptr ) {
if ( env_ ! = nullptr & & stats_ ! = nullptr ) {