forked from facebook/rocksdb
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yang Zhang <[email protected]>
- Loading branch information
Showing
11 changed files
with
236 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
// complements to perf_level | ||
#pragma once | ||
|
||
#include <bitset> | ||
#include <cstdint> | ||
#include <initializer_list> | ||
|
||
#include "rocksdb/rocksdb_namespace.h" | ||
|
||
namespace ROCKSDB_NAMESPACE { | ||
|
||
enum PerfFlag : uint32_t { | ||
user_key_comparison_count = 0, | ||
block_cache_hit_count, | ||
block_read_count, | ||
block_read_byte, | ||
block_read_time, | ||
block_read_cpu_time, | ||
block_cache_index_hit_count, | ||
block_cache_standalone_handle_count, | ||
block_cache_real_handle_count, | ||
index_block_read_count, | ||
block_cache_filter_hit_count, | ||
filter_block_read_count, | ||
compression_dict_block_read_count, | ||
secondary_cache_hit_count, | ||
compressed_sec_cache_insert_real_count, | ||
compressed_sec_cache_insert_dummy_count, | ||
compressed_sec_cache_uncompressed_bytes, | ||
compressed_sec_cache_compressed_bytes, | ||
block_checksum_time, | ||
block_decompress_time, | ||
get_read_bytes, | ||
multiget_read_bytes, | ||
iter_read_bytes, | ||
blob_cache_hit_count, | ||
blob_read_count, | ||
blob_read_byte, | ||
blob_read_time, | ||
blob_checksum_time, | ||
blob_decompress_time, | ||
internal_key_skipped_count, | ||
internal_delete_skipped_count, | ||
internal_recent_skipped_count, | ||
internal_merge_count, | ||
internal_merge_point_lookup_count, | ||
internal_range_del_reseek_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_scheduling_flushes_compactions_time, | ||
write_pre_and_post_process_time, | ||
write_thread_wait_nanos, | ||
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, | ||
env_new_sequential_file_nanos, | ||
env_new_random_access_file_nanos, | ||
env_new_writable_file_nanos, | ||
env_reuse_writable_file_nanos, | ||
env_new_random_rw_file_nanos, | ||
env_new_directory_nanos, | ||
env_file_exists_nanos, | ||
env_get_children_nanos, | ||
env_get_children_file_attributes_nanos, | ||
env_delete_file_nanos, | ||
env_create_dir_nanos, | ||
env_create_dir_if_missing_nanos, | ||
env_delete_dir_nanos, | ||
env_get_file_size_nanos, | ||
env_get_file_modification_time_nanos, | ||
env_rename_file_nanos, | ||
env_link_file_nanos, | ||
env_lock_file_nanos, | ||
env_unlock_file_nanos, | ||
env_new_logger_nanos, | ||
get_cpu_nanos, | ||
iter_next_cpu_nanos, | ||
iter_prev_cpu_nanos, | ||
iter_seek_cpu_nanos, | ||
iter_next_count, | ||
iter_prev_count, | ||
iter_seek_count, | ||
encrypt_data_nanos, | ||
decrypt_data_nanos, | ||
number_async_seek, | ||
|
||
get_from_table_nanos, | ||
user_key_return_count, | ||
block_cache_miss_count, | ||
bloom_filter_full_positive, | ||
bloom_filter_useful, | ||
bloom_filter_full_true_positive, | ||
|
||
bytes_read, | ||
bytes_written, | ||
open_nanos, | ||
allocate_nanos, | ||
write_nanos, | ||
read_nanos, | ||
range_sync_nanos, | ||
prepare_write_nanos, | ||
fsync_nanos, | ||
logger_nanos, | ||
cpu_read_nanos, | ||
cpu_write_nanos, | ||
// Should always be the last | ||
COUNT | ||
}; | ||
|
||
using PerfFlags = std::bitset<PerfFlag::COUNT>; | ||
|
||
PerfFlags NewPerfFlags(std::initializer_list<PerfFlag> l); | ||
bool CheckPerfFlag(PerfFlag flag); | ||
PerfFlags GetPerfFlags(); | ||
void SetPerfFlags(PerfFlags flags); | ||
|
||
} // namespace ROCKSDB_NAMESPACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include "rocksdb/perf_flag.h" | ||
|
||
namespace ROCKSDB_NAMESPACE { | ||
|
||
thread_local PerfFlags perf_flags = {}; | ||
|
||
PerfFlags NewPerfFlags(std::initializer_list<PerfFlag> l) { | ||
PerfFlags flags; | ||
for (const PerfFlag& f : l) { | ||
flags.set(f); | ||
} | ||
return flags; | ||
} | ||
|
||
bool CheckPerfFlag(PerfFlag flag) { return perf_flags.test(flag); } | ||
|
||
PerfFlags GetPerfFlags() { return perf_flags; } | ||
|
||
void SetPerfFlags(PerfFlags flags) { perf_flags = flags; } | ||
|
||
} // namespace ROCKSDB_NAMESPACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. | ||
// This source code is licensed under both the GPLv2 (found in the | ||
// COPYING file in the root directory) and Apache 2.0 License | ||
// (found in the LICENSE.Apache file in the root directory). | ||
// | ||
#pragma once | ||
|
||
#include <cstdint> | ||
|
||
#include "rocksdb/perf_flag.h" | ||
|
||
namespace ROCKSDB_NAMESPACE { | ||
#ifdef ROCKSDB_SUPPORT_THREAD_LOCAL | ||
extern __thread PerfFlags perf_flags; | ||
#else | ||
extern PerfFlags perf_flags; | ||
#endif | ||
} // namespace ROCKSDB_NAMESPACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters