Skip to content

Commit

Permalink
[RocksDB] Print all internally collected histograms in db_bench. Also…
Browse files Browse the repository at this point in the history
… print p95

Summary: $title

Test Plan: make db_bench . run db_bench and check for expected output

Reviewers: haobo, dhruba

Reviewed By: haobo

CC: leveldb

Differential Revision: https://reviews.facebook.net/D10521
  • Loading branch information
Abhishek Kona committed Apr 25, 2013
1 parent ae558b5 commit fb96ec1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions db/db_bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -695,9 +695,10 @@ class Benchmark {
void PrintHistogram(Histograms histogram_type, std::string name) {
HistogramData histogramData;
dbstats->histogramData(histogram_type, &histogramData);
fprintf(stdout, "%s statistics : \n", name.c_str());
fprintf(stdout, "Median : %f\n",histogramData.median);
fprintf(stdout, "99ile : %f\n", histogramData.percentile99);
fprintf(stdout, "%s statistics Percentiles :", name.c_str());
fprintf(stdout, "50 : %f ",histogramData.median);
fprintf(stdout, "95 : %f ", histogramData.percentile95);
fprintf(stdout, "99 : %f\n", histogramData.percentile99);
}

void PrintStatistics() {
Expand All @@ -718,6 +719,7 @@ class Benchmark {
dbstats->getTickerCount(COMPACTION_KEY_DROP_USER));
PrintHistogram(DB_GET, "DB_GET");
PrintHistogram(DB_WRITE, "DB_WRITE");
PrintHistogram(COMPACTION_TIME, "COMPACTION_TIME");
}
}

Expand Down

0 comments on commit fb96ec1

Please sign in to comment.