Add multireadwhilewriting benchmark to db_bench (#10919)

Summary:
Add the new benchmark

Pull Request resolved: https://github.com/facebook/rocksdb/pull/10919

Reviewed By: akankshamahajan15

Differential Revision: D41017025

Pulled By: anand1976

fbshipit-source-id: 5220815d66de1f689b7f09d9c5266cebf4e345d1
main
anand76 2 years ago committed by Facebook GitHub Bot
parent 18cb731f27
commit aafe7bd376
  1. 13
      tools/db_bench_tool.cc

@ -3498,6 +3498,11 @@ class Benchmark {
fprintf(stderr, "entries_per_batch = %" PRIi64 "\n",
entries_per_batch_);
method = &Benchmark::MultiReadRandom;
} else if (name == "multireadwhilewriting") {
fprintf(stderr, "entries_per_batch = %" PRIi64 "\n",
entries_per_batch_);
num_threads++;
method = &Benchmark::MultiReadWhileWriting;
} else if (name == "approximatesizerandom") {
fprintf(stderr, "entries_per_batch = %" PRIi64 "\n",
entries_per_batch_);
@ -6895,6 +6900,14 @@ class Benchmark {
}
}
void MultiReadWhileWriting(ThreadState* thread) {
if (thread->tid > 0) {
MultiReadRandom(thread);
} else {
BGWriter(thread, kWrite);
}
}
void ReadWhileMerging(ThreadState* thread) {
if (thread->tid > 0) {
ReadRandom(thread);

Loading…
Cancel
Save