This is an automated email from the ASF dual-hosted git repository.

hulk pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks.git


The following commit(s) were added to refs/heads/unstable by this push:
     new 433dcfb3 Remove redundant info about `block_cache_usage` field (#2242)
433dcfb3 is described below

commit 433dcfb39b689503b747eabaf922a8718a1d4575
Author: anotherJJz <[email protected]>
AuthorDate: Sun Apr 14 21:20:57 2024 +0800

    Remove redundant info about `block_cache_usage` field (#2242)
---
 src/server/server.cc | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/server/server.cc b/src/server/server.cc
index d4ed564e..f131bccd 100644
--- a/src/server/server.cc
+++ b/src/server/server.cc
@@ -846,13 +846,20 @@ void Server::GetRocksDBInfo(std::string *info) {
   db->GetAggregatedIntProperty("rocksdb.num-live-versions", 
&num_live_versions);
 
   string_stream << "# RocksDB\r\n";
+
+  uint64_t block_cache_usage = 0;
+  // All column families share the same block cache, so it's good to count a 
single one.
+  auto subkey_cf_handle = 
storage->GetCFHandle(engine::kSubkeyColumnFamilyName);
+  db->GetIntProperty(subkey_cf_handle, "rocksdb.block-cache-usage", 
&block_cache_usage);
+  string_stream << "block_cache_usage:" << block_cache_usage << "\r\n";
+
   for (const auto &cf_handle : *storage->GetCFHandles()) {
-    uint64_t estimate_keys = 0, block_cache_usage = 0, 
block_cache_pinned_usage = 0, index_and_filter_cache_usage = 0;
+    uint64_t estimate_keys = 0;
+    uint64_t block_cache_pinned_usage = 0;
+    uint64_t index_and_filter_cache_usage = 0;
     std::map<std::string, std::string> cf_stats_map;
     db->GetIntProperty(cf_handle, "rocksdb.estimate-num-keys", &estimate_keys);
     string_stream << "estimate_keys[" << cf_handle->GetName() << "]:" << 
estimate_keys << "\r\n";
-    db->GetIntProperty(cf_handle, "rocksdb.block-cache-usage", 
&block_cache_usage);
-    string_stream << "block_cache_usage[" << cf_handle->GetName() << "]:" << 
block_cache_usage << "\r\n";
     db->GetIntProperty(cf_handle, "rocksdb.block-cache-pinned-usage", 
&block_cache_pinned_usage);
     string_stream << "block_cache_pinned_usage[" << cf_handle->GetName() << 
"]:" << block_cache_pinned_usage << "\r\n";
     db->GetIntProperty(cf_handle, "rocksdb.estimate-table-readers-mem", 
&index_and_filter_cache_usage);

Reply via email to