diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index f0b5eb493..68488cb40 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -758,6 +758,9 @@ DEFINE_bool(show_table_properties, false, DEFINE_string(db, "", "Use the db with the following name."); +DEFINE_bool(progress_reports, true, + "If true, db_bench will report number of finished operations."); + // Read cache flags DEFINE_string(read_cache_path, "", @@ -2252,7 +2255,7 @@ class Stats { } done_ += num_ops; - if (done_ >= next_report_) { + if (done_ >= next_report_ && FLAGS_progress_reports) { if (!FLAGS_stats_interval) { if (next_report_ < 1000) next_report_ += 100; else if (next_report_ < 5000) next_report_ += 500; @@ -3814,6 +3817,10 @@ class Benchmark { perf_context.EnablePerLevelPerfContext(); thread->stats.Start(thread->tid); (arg->bm->*(arg->method))(thread); + if (FLAGS_perf_level > ROCKSDB_NAMESPACE::PerfLevel::kDisable) { + thread->stats.AddMessage(std::string("PERF_CONTEXT:\n") + + get_perf_context()->ToString()); + } thread->stats.Stop(); { @@ -5743,10 +5750,6 @@ class Benchmark { delete iter; thread->stats.AddBytes(bytes); - if (FLAGS_perf_level > ROCKSDB_NAMESPACE::PerfLevel::kDisable) { - thread->stats.AddMessage(std::string("PERF_CONTEXT:\n") + - get_perf_context()->ToString()); - } } void ReadToRowCache(ThreadState* thread) { @@ -5800,11 +5803,6 @@ class Benchmark { thread->stats.AddBytes(bytes); thread->stats.AddMessage(msg); - - if (FLAGS_perf_level > ROCKSDB_NAMESPACE::PerfLevel::kDisable) { - thread->stats.AddMessage(std::string("PERF_CONTEXT:\n") + - get_perf_context()->ToString()); - } } void ReadReverse(ThreadState* thread) { @@ -5896,11 +5894,6 @@ class Benchmark { found, read, nonexist); thread->stats.AddMessage(msg); - - if (FLAGS_perf_level > ROCKSDB_NAMESPACE::PerfLevel::kDisable) { - thread->stats.AddMessage(std::string("PERF_CONTEXT:\n") + - get_perf_context()->ToString()); - } } int64_t GetRandomKey(Random64* rand) { @@ -6036,11 +6029,6 @@ class Benchmark { thread->stats.AddBytes(bytes); thread->stats.AddMessage(msg); - - if (FLAGS_perf_level > ROCKSDB_NAMESPACE::PerfLevel::kDisable) { - thread->stats.AddMessage(std::string("PERF_CONTEXT:\n") + - get_perf_context()->ToString()); - } } // Calls MultiGet over a list of keys from a random distribution. @@ -6602,11 +6590,6 @@ class Benchmark { thread->stats.AddBytes(bytes); thread->stats.AddMessage(msg); - - if (FLAGS_perf_level > ROCKSDB_NAMESPACE::PerfLevel::kDisable) { - thread->stats.AddMessage(std::string("PERF_CONTEXT:\n") + - get_perf_context()->ToString()); - } } void IteratorCreation(ThreadState* thread) { @@ -6756,10 +6739,6 @@ class Benchmark { found, read); thread->stats.AddBytes(bytes); thread->stats.AddMessage(msg); - if (FLAGS_perf_level > ROCKSDB_NAMESPACE::PerfLevel::kDisable) { - thread->stats.AddMessage(std::string("PERF_CONTEXT:\n") + - get_perf_context()->ToString()); - } } void SeekRandomWhileWriting(ThreadState* thread) { @@ -7782,11 +7761,6 @@ class Benchmark { snprintf(msg, sizeof(msg), "( batches:%" PRIu64 " )", transactions_done); } thread->stats.AddMessage(msg); - - if (FLAGS_perf_level > ROCKSDB_NAMESPACE::PerfLevel::kDisable) { - thread->stats.AddMessage(std::string("PERF_CONTEXT:\n") + - get_perf_context()->ToString()); - } thread->stats.AddBytes(static_cast(inserter.GetBytesInserted())); } @@ -7965,10 +7939,6 @@ class Benchmark { read); thread->stats.AddBytes(bytes); thread->stats.AddMessage(msg); - if (FLAGS_perf_level > ROCKSDB_NAMESPACE::PerfLevel::kDisable) { - thread->stats.AddMessage(std::string("PERF_CONTEXT:\n") + - get_perf_context()->ToString()); - } } void TimeSeriesWrite(ThreadState* thread) {