Skip to content

Commit

Permalink
db_bench: Add table-readers-mem benchmark (#575)
Browse files Browse the repository at this point in the history
This benchmark prints the memory estimated to be used by the table readers.
Excluding blocks in block cache.
  • Loading branch information
Yuval-Ariel authored Jun 26, 2023
1 parent ea3bdd5 commit 3ee5632
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

### Enhancements
* db_bench: add estimate-table-readers-mem benchmark which prints these stats.

## Fig v2.5.0 (06/14/2023)
Based on RocksDB 8.1.1

Expand Down
5 changes: 5 additions & 0 deletions tools/db_bench_tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ DEFINE_string(
"\twaitforcompaction - pause until compaction is (probably) done\n"
"\tflush - flush the memtable\n"
"\tstats -- Print DB stats\n"
"\ttable-readers-mem -- Print table readers memory. excluding memory "
"used in block cache\n"
"\tresetstats -- Reset DB stats\n"
"\tlevelstats -- Print the number of files and bytes per level\n"
"\tmemstats -- Print memtable stats\n"
Expand Down Expand Up @@ -3963,6 +3965,9 @@ class Benchmark {
PrintStats("rocksdb.block-cache-entry-stats");
} else if (name == "stats") {
PrintStats("rocksdb.stats");
} else if (name == "table-readers-mem") {
fprintf(stdout, "table-readers-mem");
PrintStats("rocksdb.estimate-table-readers-mem");
} else if (name == "resetstats") {
ResetStats();
} else if (name == "verify") {
Expand Down

0 comments on commit 3ee5632

Please sign in to comment.