diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 367bacfb2..b63b0a9a4 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -2265,25 +2265,23 @@ class Stats { if (done_ < 1) done_ = 1; std::string extra; + double elapsed = (finish_ - start_) * 1e-6; if (bytes_ > 0) { // Rate is computed on actual elapsed time, not the sum of per-thread // elapsed times. - double elapsed = (finish_ - start_) * 1e-6; char rate[100]; snprintf(rate, sizeof(rate), "%6.1f MB/s", (bytes_ / 1048576.0) / elapsed); extra = rate; } AppendWithSpace(&extra, message_); - double elapsed = (finish_ - start_) * 1e-6; double throughput = (double)done_/elapsed; - fprintf(stdout, "%-12s : %11.3f micros/op %ld ops/sec;%s%s\n", - name.ToString().c_str(), - seconds_ * 1e6 / done_, - (long)throughput, - (extra.empty() ? "" : " "), - extra.c_str()); + fprintf(stdout, + "%-12s : %11.3f micros/op %ld ops/sec %.3f seconds %" PRIu64 + " operations;%s%s\n", + name.ToString().c_str(), seconds_ * 1e6 / done_, (long)throughput, + elapsed, done_, (extra.empty() ? "" : " "), extra.c_str()); if (FLAGS_histogram) { for (auto it = hist_.begin(); it != hist_.end(); ++it) { fprintf(stdout, "Microseconds per %s:\n%s\n",