From c35bf88a4dbddd8936ed6d88b2c2d7e3df99d90a Mon Sep 17 00:00:00 2001 From: rabunkosar-dd Date: Wed, 15 Jan 2025 12:52:02 -0800 Subject: [PATCH] config update and fix formatting --- kvrocks.conf | 2 +- src/stats/stats.h | 7 ++++--- tests/cppunit/config_test.cc | 2 -- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/kvrocks.conf b/kvrocks.conf index 6f964f65629..461d077eb3f 100644 --- a/kvrocks.conf +++ b/kvrocks.conf @@ -383,7 +383,7 @@ txn-context-enabled no # NOTE: This is an experimental feature. There might be some performance overhead when using this # feature, please be aware. # Default: disabled -histogram-bucket-boundaries 10,20,40,60,80,100,150,250,350,500,750,1000,1500,2000,4000,8000 +# histogram-bucket-boundaries 10,20,40,60,80,100,150,250,350,500,750,1000,1500,2000,4000,8000 ################################## TLS ################################### diff --git a/src/stats/stats.h b/src/stats/stats.h index 7d5bc02c4cd..eea220eeb31 100644 --- a/src/stats/stats.h +++ b/src/stats/stats.h @@ -83,9 +83,7 @@ class Stats { BucketBoundaries bucket_boundaries; std::map commands_histogram; - Config *config_ = nullptr; - - Stats(Config *config); + explicit Stats(Config *config); void IncrCalls(const std::string &command_name); void IncrLatency(uint64_t latency, const std::string &command_name); @@ -97,4 +95,7 @@ class Stats { static int64_t GetMemoryRSS(); void TrackInstantaneousMetric(int metric, uint64_t current_reading); uint64_t GetInstantaneousMetric(int metric) const; + +private: + Config *config_ = nullptr; }; diff --git a/tests/cppunit/config_test.cc b/tests/cppunit/config_test.cc index d0687c333a3..2a6ac1b5608 100644 --- a/tests/cppunit/config_test.cc +++ b/tests/cppunit/config_test.cc @@ -130,9 +130,7 @@ TEST(Config, GetAndSet) { {"rocksdb.rate_limiter_auto_tuned", "yes"}, {"rocksdb.compression_level", "32767"}, {"rocksdb.wal_compression", "no"}, -#ifdef ENABLE_HISTOGRAMS {"histogram-bucket-boundaries", "10,100,1000,10000"}, -#endif }; for (const auto &iter : immutable_cases) {