uint64_t filter_block_read_count; // total number of filter block reads
uint64_t compression_dict_block_read_count; // total number of compression
// dictionary block reads
+ // Cumulative size of blocks found in block cache
+ uint64_t block_cache_index_read_byte;
+ uint64_t block_cache_filter_read_byte;
+ uint64_t block_cache_compression_dict_read_byte;
+ uint64_t block_cache_read_byte;
uint64_t secondary_cache_hit_count; // total number of secondary cache hits
// total number of real handles inserted into secondary cache
return perf_context->block_read_cpu_time;
}
+/*
+ * Class: org_rocksdb_PerfContext
+ * Method: getBlockCacheIndexReadByte
+ * Signature: (J)J
+ */
+jlong Java_org_rocksdb_PerfContext_getBlockCacheIndexReadByte(
+ JNIEnv*, jobject, jlong jpc_handle) {
+ ROCKSDB_NAMESPACE::PerfContext* perf_context =
+ reinterpret_cast<ROCKSDB_NAMESPACE::PerfContext*>(jpc_handle);
+ return perf_context->block_cache_index_read_byte;
+}
+
+/*
+ * Class: org_rocksdb_PerfContext
+ * Method: getBlockCacheFilterReadByte
+ * Signature: (J)J
+ */
+jlong Java_org_rocksdb_PerfContext_getBlockCacheFilterReadByte(
+ JNIEnv*, jobject, jlong jpc_handle) {
+ ROCKSDB_NAMESPACE::PerfContext* perf_context =
+ reinterpret_cast<ROCKSDB_NAMESPACE::PerfContext*>(jpc_handle);
+ return perf_context->block_cache_filter_read_byte;
+}
+
+/*
+ * Class: org_rocksdb_PerfContext
+ * Method: getBlockCacheCompressionDictReadByte
+ * Signature: (J)J
+ */
+jlong Java_org_rocksdb_PerfContext_getBlockCacheCompressionDictReadByte(
+ JNIEnv*, jobject, jlong jpc_handle) {
+ ROCKSDB_NAMESPACE::PerfContext* perf_context =
+ reinterpret_cast<ROCKSDB_NAMESPACE::PerfContext*>(jpc_handle);
+ return perf_context->block_cache_compression_dict_read_byte;
+}
+
+/*
+ * Class: org_rocksdb_PerfContext
+ * Method: getBlockCacheReadByte
+ * Signature: (J)J
+ */
+jlong Java_org_rocksdb_PerfContext_getBlockCacheReadByte(JNIEnv*, jobject,
+ jlong jpc_handle) {
+ ROCKSDB_NAMESPACE::PerfContext* perf_context =
+ reinterpret_cast<ROCKSDB_NAMESPACE::PerfContext*>(jpc_handle);
+ return perf_context->block_cache_read_byte;
+}
+
/*
* Class: org_rocksdb_PerfContext
* Method: getSecondaryCacheHitCount
defCmd(block_cache_filter_hit_count) \
defCmd(filter_block_read_count) \
defCmd(compression_dict_block_read_count) \
+ defCmd(block_cache_index_read_byte) \
+ defCmd(block_cache_filter_read_byte) \
+ defCmd(block_cache_compression_dict_read_byte) \
+ defCmd(block_cache_read_byte) \
defCmd(secondary_cache_hit_count) \
defCmd(compressed_sec_cache_insert_real_count) \
defCmd(compressed_sec_cache_insert_dummy_count) \
Statistics* const statistics = rep_->ioptions.stats;
PERF_COUNTER_ADD(block_cache_hit_count, 1);
+ PERF_COUNTER_ADD(block_cache_read_byte, usage);
PERF_COUNTER_BY_LEVEL_ADD(block_cache_hit_count, 1,
static_cast<uint32_t>(rep_->level));
case BlockType::kFilter:
case BlockType::kFilterPartitionIndex:
PERF_COUNTER_ADD(block_cache_filter_hit_count, 1);
+ PERF_COUNTER_ADD(block_cache_filter_read_byte, usage);
if (get_context) {
++get_context->get_context_stats_.num_cache_filter_hit;
case BlockType::kCompressionDictionary:
// TODO: introduce perf counter for compression dictionary hit count
+ PERF_COUNTER_ADD(block_cache_compression_dict_read_byte, usage);
if (get_context) {
++get_context->get_context_stats_.num_cache_compression_dict_hit;
} else {
case BlockType::kIndex:
PERF_COUNTER_ADD(block_cache_index_hit_count, 1);
+ PERF_COUNTER_ADD(block_cache_index_read_byte, usage);
if (get_context) {
++get_context->get_context_stats_.num_cache_index_hit;
--- /dev/null
+Added new PerfContext counters for block cache bytes read - block_cache_index_read_byte, block_cache_filter_read_byte, block_cache_compression_dict_read_byte, and block_cache_read_byte.