diff --git a/tools/db_crashtest.py b/tools/db_crashtest.py index 2979a0508035949f9a6ec0ce5e9a1b744e028965..644124d2868d4e2e59d4d184b475458e38d3872c 100644 --- a/tools/db_crashtest.py +++ b/tools/db_crashtest.py @@ -85,6 +85,7 @@ def main(argv): --open_files=500000 --verify_checksum=1 --sync=0 + --progress_reports=0 --disable_wal=0 --disable_data_sync=1 --target_file_size_base=2097152 diff --git a/tools/db_crashtest2.py b/tools/db_crashtest2.py index 68cc42cf3d769944d1371c4c976d7d3b382eb5d3..3d44d0be428984fa3c8f9b58c48ce9034756d587 100644 --- a/tools/db_crashtest2.py +++ b/tools/db_crashtest2.py @@ -99,6 +99,7 @@ def main(argv): --open_files=500000 --verify_checksum=1 --sync=0 + --progress_reports=0 --disable_wal=0 --disable_data_sync=1 --target_file_size_base=2097152 diff --git a/tools/db_stress.cc b/tools/db_stress.cc index f66f272b8fe5098329e01ca5d941e871e86bf886..76841e6d13817917a77bcc90119c6e99a59f47d9 100644 --- a/tools/db_stress.cc +++ b/tools/db_stress.cc @@ -97,7 +97,10 @@ DEFINE_bool(histogram, false, "Print histogram of operation timings"); DEFINE_bool(destroy_db_initially, true, "Destroys the database dir before start if this is true"); -DEFINE_bool (verbose, false, "Verbose"); +DEFINE_bool(verbose, false, "Verbose"); + +DEFINE_bool(progress_reports, true, + "If true, db_stress will report number of finished operations"); DEFINE_int32(write_buffer_size, rocksdb::Options().write_buffer_size, "Number of bytes to buffer in memtable before compacting"); @@ -444,16 +447,18 @@ class Stats { last_op_finish_ = now; } - done_++; - if (done_ >= next_report_) { - if (next_report_ < 1000) next_report_ += 100; - else if (next_report_ < 5000) next_report_ += 500; - else if (next_report_ < 10000) next_report_ += 1000; - else if (next_report_ < 50000) next_report_ += 5000; - else if (next_report_ < 100000) next_report_ += 10000; - else if (next_report_ < 500000) next_report_ += 50000; - else next_report_ += 100000; - fprintf(stdout, "... finished %ld ops%30s\r", done_, ""); + if (FLAGS_progress_reports) { + done_++; + if (done_ >= next_report_) { + if (next_report_ < 1000) next_report_ += 100; + else if (next_report_ < 5000) next_report_ += 500; + else if (next_report_ < 10000) next_report_ += 1000; + else if (next_report_ < 50000) next_report_ += 5000; + else if (next_report_ < 100000) next_report_ += 10000; + else if (next_report_ < 500000) next_report_ += 50000; + else next_report_ += 100000; + fprintf(stdout, "... finished %ld ops%30s\r", done_, ""); + } } }