Skip to content

Commit

Permalink
Add more rates to db_bench output
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mdcallag committed Oct 29, 2012
1 parent de7689b commit acc8567
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions db/db_bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions db/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit acc8567

Please sign in to comment.