diff --git a/db/db_properties_test.cc b/db/db_properties_test.cc index ed8c561cc..50e08c45f 100644 --- a/db/db_properties_test.cc +++ b/db/db_properties_test.cc @@ -428,7 +428,7 @@ TEST_F(DBPropertiesTest, NumImmutableMemTable) { writeOpt.disableWAL = true; options.max_write_buffer_number = 4; options.min_write_buffer_number_to_merge = 3; - options.max_write_buffer_number_to_maintain = 0; + options.max_write_buffer_number_to_maintain = 4; options.write_buffer_size = 1000000; CreateAndReopenWithCF({"pikachu"}, options); @@ -441,6 +441,9 @@ TEST_F(DBPropertiesTest, NumImmutableMemTable) { ASSERT_TRUE(dbfull()->GetProperty(handles_[1], "rocksdb.num-immutable-mem-table", &num)); ASSERT_EQ(num, "0"); + ASSERT_TRUE(dbfull()->GetProperty( + handles_[1], DB::Properties::kNumImmutableMemTableFlushed, &num)); + ASSERT_EQ(num, "0"); ASSERT_TRUE(dbfull()->GetProperty( handles_[1], "rocksdb.num-entries-active-mem-table", &num)); ASSERT_EQ(num, "1"); @@ -492,6 +495,9 @@ TEST_F(DBPropertiesTest, NumImmutableMemTable) { ASSERT_TRUE(dbfull()->GetProperty(handles_[1], "rocksdb.num-immutable-mem-table", &num)); ASSERT_EQ(num, "0"); + ASSERT_TRUE(dbfull()->GetProperty( + handles_[1], DB::Properties::kNumImmutableMemTableFlushed, &num)); + ASSERT_EQ(num, "3"); ASSERT_TRUE(dbfull()->GetProperty( handles_[1], "rocksdb.cur-size-active-mem-table", &num)); // "192" is the size of the metadata of an empty skiplist, this would diff --git a/db/internal_stats.cc b/db/internal_stats.cc index 74aac3649..33839d17e 100644 --- a/db/internal_stats.cc +++ b/db/internal_stats.cc @@ -136,8 +136,11 @@ const std::string DB::Properties::kStats = rocksdb_prefix + allstats; const std::string DB::Properties::kSSTables = rocksdb_prefix + sstables; const std::string DB::Properties::kCFStats = rocksdb_prefix + cfstats; const std::string DB::Properties::kDBStats = rocksdb_prefix + dbstats; +const std::string DB::Properties::kLevelStats = rocksdb_prefix + levelstats; const std::string DB::Properties::kNumImmutableMemTable = rocksdb_prefix + num_immutable_mem_table; +const std::string DB::Properties::kNumImmutableMemTableFlushed = + rocksdb_prefix + num_immutable_mem_table_flushed; const std::string DB::Properties::kMemTableFlushPending = rocksdb_prefix + mem_table_flush_pending; const std::string DB::Properties::kCompactionPending = diff --git a/include/rocksdb/db.h b/include/rocksdb/db.h index 9bc0993c5..a94496a65 100644 --- a/include/rocksdb/db.h +++ b/include/rocksdb/db.h @@ -343,11 +343,14 @@ class DB { // of the sstables that make up the db contents. // "rocksdb.cfstats" // "rocksdb.dbstats" + // "rocksdb.levelstats" // "rocksdb.num-immutable-mem-table" // "rocksdb.mem-table-flush-pending" + // "rocksdb.num-immutable-mem-table-flushed" // "rocksdb.compaction-pending" - 1 if at least one compaction is pending // "rocksdb.background-errors" - accumulated number of background errors // "rocksdb.cur-size-active-mem-table" + // "rocksdb.cur-size-all-mem-tables" // "rocksdb.size-all-mem-tables" // "rocksdb.num-entries-active-mem-table" // "rocksdb.num-entries-imm-mem-tables" @@ -386,7 +389,9 @@ class DB { static const std::string kSSTables; static const std::string kCFStats; static const std::string kDBStats; + static const std::string kLevelStats; static const std::string kNumImmutableMemTable; + static const std::string kNumImmutableMemTableFlushed; static const std::string kMemTableFlushPending; static const std::string kNumRunningFlushes; static const std::string kCompactionPending;