1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved. 2 // This source code is licensed under both the GPLv2 (found in the 3 // COPYING file in the root directory) and Apache 2.0 License 4 // (found in the LICENSE.Apache file in the root directory). 5 6 #pragma once 7 8 #include <stdint.h> 9 #include <string> 10 11 #include "rocksdb/rocksdb_namespace.h" 12 13 namespace ROCKSDB_NAMESPACE { 14 15 // How much perf stats to collect. Affects perf_context and iostats_context. 16 enum PerfLevel : unsigned char { 17 kUninitialized = 0, // unknown setting 18 kDisable = 1, // disable perf stats 19 kEnableCount = 2, // enable only count stats 20 kEnableTimeExceptForMutex = 3, // Other than count stats, also enable time 21 // stats except for mutexes 22 // Other than time, also measure CPU time counters. Still don't measure 23 // time (neither wall time nor CPU time) for mutexes. 24 kEnableTimeAndCPUTimeExceptForMutex = 4, 25 kEnableTime = 5, // enable count and time stats 26 kOutOfBounds = 6 // N.B. Must always be the last value! 27 }; 28 29 // set the perf stats level for current thread 30 void SetPerfLevel(PerfLevel level); 31 32 // get current perf stats level for current thread 33 PerfLevel GetPerfLevel(); 34 35 } // namespace ROCKSDB_NAMESPACE 36