db_bench randomtransaction print throughput

Summary:
print throughput in MB/s upon finishing randomtransaction benchmark
Closes https://github.com/facebook/rocksdb/pull/3016

Differential Revision: D6070426

Pulled By: ajkr

fbshipit-source-id: 69df43beed4c374a36d826e761ca3a83e1fdcbf5
main
Andrew Kryczka 7 years ago committed by Facebook Github Bot
parent 60c09f5fbb
commit 731895214b
  1. 1
      tools/db_bench_tool.cc
  2. 1
      util/transaction_test_util.cc
  3. 5
      util/transaction_test_util.h

@ -4944,6 +4944,7 @@ void VerifyDBFromDB(std::string& truth_db_name) {
if (FLAGS_perf_level > rocksdb::PerfLevel::kDisable) {
thread->stats.AddMessage(get_perf_context()->ToString());
}
thread->stats.AddBytes(static_cast<int64_t>(inserter.GetBytesInserted()));
}
// Verifies consistency of data after RandomTransaction() has been run.

@ -132,6 +132,7 @@ bool RandomTransactionInserter::DoInsert(DB* db, Transaction* txn,
} else {
batch.Put(key, sum);
}
bytes_inserted_ += key.size() + sum.size();
}
}

@ -83,6 +83,9 @@ class RandomTransactionInserter {
// write any data.
uint64_t GetFailureCount() { return failure_count_; }
// Returns the sum of user keys/values Put() to the DB.
size_t GetBytesInserted() { return bytes_inserted_; }
private:
// Input options
Random64* rand_;
@ -97,6 +100,8 @@ class RandomTransactionInserter {
// Number of failed insert batches attempted
uint64_t failure_count_ = 0;
size_t bytes_inserted_ = 0;
// Status returned by most recent insert operation
Status last_status_;

Loading…
Cancel
Save