From d7738666b0b101df0eb3c4822aca4ee10c27694a Mon Sep 17 00:00:00 2001 From: anand76 Date: Mon, 28 Dec 2020 13:37:07 -0800 Subject: [PATCH] Fix db_bench duration for multireadrandom benchmark (#7817) Summary: The multireadrandom benchmark, when run for a specific number of reads (--reads argument), should base the duration on the actual number of keys read rather than number of batches. Tests: Run db_bench multireadrandom benchmark Pull Request resolved: https://github.com/facebook/rocksdb/pull/7817 Reviewed By: zhichao-cao Differential Revision: D25717230 Pulled By: anand1976 fbshipit-source-id: 13f4d8162268cf9a34918655e60302d0aba3864b --- tools/db_bench_tool.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 9c80ce2a9..852ea3406 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -5220,7 +5220,7 @@ class Benchmark { } Duration duration(FLAGS_duration, reads_); - while (!duration.Done(1)) { + while (!duration.Done(entries_per_batch_)) { DB* db = SelectDB(thread); if (FLAGS_multiread_stride) { int64_t key = GetRandomKey(&thread->rand);