Enable write rate limit for updaterandom benchmark

Summary:
We have FLAGS_benchmark_write_rate_limit to limit write rate in
db_bench, but it was not in use for updaterandom benchmark.
Closes https://github.com/facebook/rocksdb/pull/2578

Differential Revision: D5420328

Pulled By: yiwu-arbug

fbshipit-source-id: 5fa48c2b88f2f2dc83d615cb9c40c472bc916835
This commit is contained in:
Yi Wu 2017-07-13 16:25:53 -07:00 committed by Facebook Github Bot
parent 20a691d98f
commit 5bfb67d90f

View file

@ -489,7 +489,8 @@ static bool ValidateCacheNumshardbits(const char* flagname, int32_t value) {
return true; return true;
} }
DEFINE_bool(verify_checksum, true, "Verify checksum for every block read" DEFINE_bool(verify_checksum, true,
"Verify checksum for every block read"
" from storage"); " from storage");
DEFINE_bool(statistics, false, "Database statistics"); DEFINE_bool(statistics, false, "Database statistics");
@ -4592,6 +4593,12 @@ void VerifyDBFromDB(std::string& truth_db_name) {
abort(); abort();
} }
if (thread->shared->write_rate_limiter) {
thread->shared->write_rate_limiter->Request(
key.size() + value_size_, Env::IO_HIGH, nullptr /*stats*/,
RateLimiter::OpType::kWrite);
}
Status s = db->Put(write_options_, key, gen.Generate(value_size_)); Status s = db->Put(write_options_, key, gen.Generate(value_size_));
if (!s.ok()) { if (!s.ok()) {
fprintf(stderr, "put error: %s\n", s.ToString().c_str()); fprintf(stderr, "put error: %s\n", s.ToString().c_str());