From 93f26436569a013835646cee66c6fddf7da89501 Mon Sep 17 00:00:00 2001 From: Yueh-Hsuan Chiang Date: Tue, 13 May 2014 13:08:45 -0700 Subject: [PATCH 1/3] [Java] Make read benchmarks print out found / not-found information. Summary: Make read benchmarks print out found / not-found information. Test Plan: make rocksdbjava make jdb_bench cd java ./jdb_bench.sh Reviewers: haobo, sdong CC: leveldb Differential Revision: https://reviews.facebook.net/D18699 --- java/org/rocksdb/benchmark/DbBenchmark.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/java/org/rocksdb/benchmark/DbBenchmark.java b/java/org/rocksdb/benchmark/DbBenchmark.java index f03e26090..ddbafde61 100644 --- a/java/org/rocksdb/benchmark/DbBenchmark.java +++ b/java/org/rocksdb/benchmark/DbBenchmark.java @@ -800,11 +800,15 @@ public class DbBenchmark { } } } + String extra = ""; + if (benchmark.indexOf("read") >= 0) { + extra = String.format(" %s / %s found; ", stats.found_, reads_); + } System.out.printf( - "%-16s : %11.5f micros/op; %6.1f MB/s; %d / %d task(s) finished.\n", + "%-16s : %11.5f micros/op; %6.1f MB/s;%s %d / %d task(s) finished.\n", benchmark, (double) elapsedSeconds / stats.done_ * 1e6, - (stats.bytes_ / 1048576.0) / elapsedSeconds, + (stats.bytes_ / 1048576.0) / elapsedSeconds, extra, taskFinishedCount, concurrentThreads); } From 8c2c4602ee7b2a6a62d22a2a625009b1aea8e5e5 Mon Sep 17 00:00:00 2001 From: sdong Date: Tue, 13 May 2014 14:42:31 -0700 Subject: [PATCH 2/3] FixedPrefixTransform to include prefix length in its name Summary: As title Test Plan: make all check. Reviewers: haobo, igor, yhchiang Reviewed By: igor CC: leveldb Differential Revision: https://reviews.facebook.net/D18705 --- util/slice.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/util/slice.cc b/util/slice.cc index 55f561f0c..5a1f4f10e 100644 --- a/util/slice.cc +++ b/util/slice.cc @@ -17,13 +17,14 @@ namespace { class FixedPrefixTransform : public SliceTransform { private: size_t prefix_len_; + std::string name_; public: - explicit FixedPrefixTransform(size_t prefix_len) : prefix_len_(prefix_len) { } + explicit FixedPrefixTransform(size_t prefix_len) + : prefix_len_(prefix_len), + name_("rocksdb.FixedPrefix." + std::to_string(prefix_len_)) {} - virtual const char* Name() const { - return "rocksdb.FixedPrefix"; - } + virtual const char* Name() const { return name_.c_str(); } virtual Slice Transform(const Slice& src) const { assert(InDomain(src)); From e883407ead0fe3a14cb5de1d9d493c92ae57ef88 Mon Sep 17 00:00:00 2001 From: Yueh-Hsuan Chiang Date: Tue, 13 May 2014 16:44:53 -0700 Subject: [PATCH 3/3] [Java] Refined the output of Java DbBenchmark. --- java/org/rocksdb/benchmark/DbBenchmark.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java/org/rocksdb/benchmark/DbBenchmark.java b/java/org/rocksdb/benchmark/DbBenchmark.java index ddbafde61..9c2dcca0a 100644 --- a/java/org/rocksdb/benchmark/DbBenchmark.java +++ b/java/org/rocksdb/benchmark/DbBenchmark.java @@ -802,7 +802,9 @@ public class DbBenchmark { } String extra = ""; if (benchmark.indexOf("read") >= 0) { - extra = String.format(" %s / %s found; ", stats.found_, reads_); + extra = String.format(" %d / %d found; ", stats.found_, stats.done_); + } else { + extra = String.format(" %d ops done; ", stats.done_); } System.out.printf(