From acc8567b24490dc87425e307976cab76be3f13af Mon Sep 17 00:00:00 2001 From: Mark Callaghan Date: Mon, 29 Oct 2012 10:29:08 -0700 Subject: [PATCH] Add more rates to db_bench output Summary: Adds the "MB/sec in" and "MB/sec out" to this line: Amplification: 1.7 rate, 0.01 GB in, 0.02 GB out, 8.24 MB/sec in, 13.75 MB/sec out Changes all values to be reported per interval and since test start for this line: ... thread 0: (10000,60000) ops and (19155.6,27307.5) ops/second in (0.522041,2.197198) seconds Task ID: # Blame Rev: Test Plan: run db_bench Revert Plan: Database Impact: Memcache Impact: Other Notes: EImportant: - begin *PUBLIC* platform impact section - Bugzilla: # - end platform impact - Reviewers: dhruba Reviewed By: dhruba Differential Revision: https://reviews.facebook.net/D6291 --- db/db_bench.cc | 8 +++++--- db/db_impl.cc | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/db/db_bench.cc b/db/db_bench.cc index c5e838176..d298ac29e 100644 --- a/db/db_bench.cc +++ b/db/db_bench.cc @@ -338,12 +338,14 @@ class Stats { } else { double now = FLAGS_env->NowMicros(); fprintf(stderr, - "... thread %d: (%ld,%ld) ops (interval,total) in %.6f seconds and %.2f ops/sec\n", + "... thread %d: (%ld,%ld) ops and (%.1f,%.1f) ops/second in (%.6f,%.6f) seconds\n", id_, done_ - last_report_done_, done_, - (now - last_report_finish_) / 1000000.0, (done_ - last_report_done_) / - ((now - last_report_finish_) / 1000000.0)); + ((now - last_report_finish_) / 1000000.0), + done_ / ((now - start_) / 1000000.0), + (now - last_report_finish_) / 1000000.0, + (now - start_) / 1000000.0); if (FLAGS_stats_per_interval) { std::string stats; diff --git a/db/db_impl.cc b/db/db_impl.cc index cd4cb05f3..f179e77dc 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -1643,10 +1643,12 @@ bool DBImpl::GetProperty(const Slice& property, std::string* value) { } snprintf(buf, sizeof(buf), - "Amplification: %.1f rate, %.2f GB in, %.2f GB out\n", + "Amplification: %.1f rate, %.2f GB in, %.2f GB out, %.2f MB/sec in, %.2f MB/sec out\n", (double) total_bytes / stats_[0].bytes_written, stats_[0].bytes_written / (1048576.0 * 1024), - total_bytes / (1048576.0 * 1024)); + total_bytes / (1048576.0 * 1024), + stats_[0].bytes_written / 1048576.0 / seconds_up, + total_bytes / 1048576.0 / seconds_up); value->append(buf); snprintf(buf, sizeof(buf), "Uptime(secs): %.1f\n", seconds_up); -- GitLab