YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense alongwiththisprogram;ifnot,writetotheFreeSoftware
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
#include <my_global.h>
#include"rdb_mariadb_port.h" /* This C++ file's header file */ #include"./rdb_perf_context.h"
// To add a new metric: // 1. Update the PC enum in rdb_perf_context.h // 2. Update sections (A), (B), and (C) below // 3. Update perf_context.test and show_engine.test
std::string rdb_pc_stat_types[] = { // (A) These should be in the same order as the PC enum "USER_KEY_COMPARISON_COUNT", "BLOCK_CACHE_HIT_COUNT", "BLOCK_READ_COUNT", "BLOCK_READ_BYTE", "BLOCK_READ_TIME", "BLOCK_CHECKSUM_TIME", "BLOCK_DECOMPRESS_TIME", "GET_READ_BYTES", "MULTIGET_READ_BYTES", "ITER_READ_BYTES", "INTERNAL_KEY_SKIPPED_COUNT", "INTERNAL_DELETE_SKIPPED_COUNT", "INTERNAL_RECENT_SKIPPED_COUNT", "INTERNAL_MERGE_COUNT", "GET_SNAPSHOT_TIME", "GET_FROM_MEMTABLE_TIME", "GET_FROM_MEMTABLE_COUNT", "GET_POST_PROCESS_TIME", "GET_FROM_OUTPUT_FILES_TIME", "SEEK_ON_MEMTABLE_TIME", "SEEK_ON_MEMTABLE_COUNT", "NEXT_ON_MEMTABLE_COUNT", "PREV_ON_MEMTABLE_COUNT", "SEEK_CHILD_SEEK_TIME", "SEEK_CHILD_SEEK_COUNT", "SEEK_MIN_HEAP_TIME", "SEEK_MAX_HEAP_TIME", "SEEK_INTERNAL_SEEK_TIME", "FIND_NEXT_USER_ENTRY_TIME", "WRITE_WAL_TIME", "WRITE_MEMTABLE_TIME", "WRITE_DELAY_TIME", "WRITE_PRE_AND_POST_PROCESS_TIME", "DB_MUTEX_LOCK_NANOS", "DB_CONDITION_WAIT_NANOS", "MERGE_OPERATOR_TIME_NANOS", "READ_INDEX_BLOCK_NANOS", "READ_FILTER_BLOCK_NANOS", "NEW_TABLE_BLOCK_ITER_NANOS", "NEW_TABLE_ITERATOR_NANOS", "BLOCK_SEEK_NANOS", "FIND_TABLE_NANOS", "BLOOM_MEMTABLE_HIT_COUNT", "BLOOM_MEMTABLE_MISS_COUNT", "BLOOM_SST_HIT_COUNT", "BLOOM_SST_MISS_COUNT", "KEY_LOCK_WAIT_TIME", "KEY_LOCK_WAIT_COUNT", "IO_THREAD_POOL_ID", "IO_BYTES_WRITTEN", "IO_BYTES_READ", "IO_OPEN_NANOS", "IO_ALLOCATE_NANOS", "IO_WRITE_NANOS", "IO_READ_NANOS", "IO_RANGE_SYNC_NANOS", "IO_LOGGER_NANOS"};
#define IO_PERF_RECORD(_field_) \ do { \ if (rocksdb::get_perf_context()->_field_ > 0) { \
counters->m_value[idx] += rocksdb::get_perf_context()->_field_; \
} \
idx++; \
} while (0) #define IO_STAT_RECORD(_field_) \ do { \ if (rocksdb::get_iostats_context()->_field_ > 0) { \
counters->m_value[idx] += rocksdb::get_iostats_context()->_field_; \
} \
idx++; \
} while (0)
staticvoid harvest_diffs(Rdb_atomic_perf_counters *const counters) { // (C) These should be in the same order as the PC enum
size_t idx = 0;
IO_PERF_RECORD(user_key_comparison_count);
IO_PERF_RECORD(block_cache_hit_count);
IO_PERF_RECORD(block_read_count);
IO_PERF_RECORD(block_read_byte);
IO_PERF_RECORD(block_read_time);
IO_PERF_RECORD(block_checksum_time);
IO_PERF_RECORD(block_decompress_time);
IO_PERF_RECORD(get_read_bytes);
IO_PERF_RECORD(multiget_read_bytes);
IO_PERF_RECORD(iter_read_bytes);
IO_PERF_RECORD(internal_key_skipped_count);
IO_PERF_RECORD(internal_delete_skipped_count);
IO_PERF_RECORD(internal_recent_skipped_count);
IO_PERF_RECORD(internal_merge_count);
IO_PERF_RECORD(get_snapshot_time);
IO_PERF_RECORD(get_from_memtable_time);
IO_PERF_RECORD(get_from_memtable_count);
IO_PERF_RECORD(get_post_process_time);
IO_PERF_RECORD(get_from_output_files_time);
IO_PERF_RECORD(seek_on_memtable_time);
IO_PERF_RECORD(seek_on_memtable_count);
IO_PERF_RECORD(next_on_memtable_count);
IO_PERF_RECORD(prev_on_memtable_count);
IO_PERF_RECORD(seek_child_seek_time);
IO_PERF_RECORD(seek_child_seek_count);
IO_PERF_RECORD(seek_min_heap_time);
IO_PERF_RECORD(seek_max_heap_time);
IO_PERF_RECORD(seek_internal_seek_time);
IO_PERF_RECORD(find_next_user_entry_time);
IO_PERF_RECORD(write_wal_time);
IO_PERF_RECORD(write_memtable_time);
IO_PERF_RECORD(write_delay_time);
IO_PERF_RECORD(write_pre_and_post_process_time);
IO_PERF_RECORD(db_mutex_lock_nanos);
IO_PERF_RECORD(db_condition_wait_nanos);
IO_PERF_RECORD(merge_operator_time_nanos);
IO_PERF_RECORD(read_index_block_nanos);
IO_PERF_RECORD(read_filter_block_nanos);
IO_PERF_RECORD(new_table_block_iter_nanos);
IO_PERF_RECORD(new_table_iterator_nanos);
IO_PERF_RECORD(block_seek_nanos);
IO_PERF_RECORD(find_table_nanos);
IO_PERF_RECORD(bloom_memtable_hit_count);
IO_PERF_RECORD(bloom_memtable_miss_count);
IO_PERF_RECORD(bloom_sst_hit_count);
IO_PERF_RECORD(bloom_sst_miss_count);
IO_PERF_RECORD(key_lock_wait_time);
IO_PERF_RECORD(key_lock_wait_count);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.