db_bench: --batch_size used for write benchmarks too

Summary: Now --bench_size is only used in multireadrandom tests, although the codes allow it to run in all write tests. I don't see a reason why we can't enable it.

Test Plan:
Run
   ./db_bench -benchmarks multirandomwrite --threads=5 -batch_size=16
and see the stats printed out in LOG to make sure batching really happened.

Reviewers: ljin, yhchiang, rven, igor

Reviewed By: igor

Subscribers: leveldb

Differential Revision: https://reviews.facebook.net/D25509
main
sdong 10 years ago
parent d755e53b87
commit 2a8e5203d8
  1. 3
      db/db_bench.cc

@ -1232,7 +1232,7 @@ class Benchmark {
writes_ = (FLAGS_writes < 0 ? FLAGS_num : FLAGS_writes); writes_ = (FLAGS_writes < 0 ? FLAGS_num : FLAGS_writes);
value_size_ = FLAGS_value_size; value_size_ = FLAGS_value_size;
key_size_ = FLAGS_key_size; key_size_ = FLAGS_key_size;
entries_per_batch_ = 1; entries_per_batch_ = FLAGS_batch_size;
write_options_ = WriteOptions(); write_options_ = WriteOptions();
if (FLAGS_sync) { if (FLAGS_sync) {
write_options_.sync = true; write_options_.sync = true;
@ -1287,7 +1287,6 @@ class Benchmark {
} else if (name == Slice("readrandomfast")) { } else if (name == Slice("readrandomfast")) {
method = &Benchmark::ReadRandomFast; method = &Benchmark::ReadRandomFast;
} else if (name == Slice("multireadrandom")) { } else if (name == Slice("multireadrandom")) {
entries_per_batch_ = FLAGS_batch_size;
fprintf(stderr, "entries_per_batch = %" PRIi64 "\n", fprintf(stderr, "entries_per_batch = %" PRIi64 "\n",
entries_per_batch_); entries_per_batch_);
method = &Benchmark::MultiReadRandom; method = &Benchmark::MultiReadRandom;

Loading…
Cancel
Save