提交 e66221ad 编写于 作者: A Andrew Kryczka 提交者: Facebook Github Bot

fix db_bench rate limiter callsites

Summary:
pass nullptr as stats object for db_bench-specific rate limiters since its stats are intended to capture background write activity only.
Closes https://github.com/facebook/rocksdb/pull/1997

Differential Revision: D4726806

Pulled By: ajkr

fbshipit-source-id: 8e4b225
上级 dbae438a
...@@ -3343,8 +3343,8 @@ class Benchmark { ...@@ -3343,8 +3343,8 @@ class Benchmark {
if (thread->shared->write_rate_limiter.get() != nullptr) { if (thread->shared->write_rate_limiter.get() != nullptr) {
thread->shared->write_rate_limiter->Request( thread->shared->write_rate_limiter->Request(
entries_per_batch_ * (value_size_ + key_size_), entries_per_batch_ * (value_size_ + key_size_), Env::IO_HIGH,
Env::IO_HIGH); nullptr /* stats */);
// Set time at which last op finished to Now() to hide latency and // Set time at which last op finished to Now() to hide latency and
// sleep from rate limiter. Also, do the check once per batch, not // sleep from rate limiter. Also, do the check once per batch, not
// once per write. // once per write.
...@@ -3704,7 +3704,8 @@ class Benchmark { ...@@ -3704,7 +3704,8 @@ class Benchmark {
if (thread->shared->read_rate_limiter.get() != nullptr && if (thread->shared->read_rate_limiter.get() != nullptr &&
i % 1024 == 1023) { i % 1024 == 1023) {
thread->shared->read_rate_limiter->Request(1024, Env::IO_HIGH); thread->shared->read_rate_limiter->Request(1024, Env::IO_HIGH,
nullptr /* stats */);
} }
} }
...@@ -3735,7 +3736,8 @@ class Benchmark { ...@@ -3735,7 +3736,8 @@ class Benchmark {
++i; ++i;
if (thread->shared->read_rate_limiter.get() != nullptr && if (thread->shared->read_rate_limiter.get() != nullptr &&
i % 1024 == 1023) { i % 1024 == 1023) {
thread->shared->read_rate_limiter->Request(1024, Env::IO_HIGH); thread->shared->read_rate_limiter->Request(1024, Env::IO_HIGH,
nullptr /* stats */);
} }
} }
delete iter; delete iter;
...@@ -3776,7 +3778,8 @@ class Benchmark { ...@@ -3776,7 +3778,8 @@ class Benchmark {
} }
} }
if (thread->shared->read_rate_limiter.get() != nullptr) { if (thread->shared->read_rate_limiter.get() != nullptr) {
thread->shared->read_rate_limiter->Request(100, Env::IO_HIGH); thread->shared->read_rate_limiter->Request(100, Env::IO_HIGH,
nullptr /* stats */);
} }
thread->stats.FinishedOps(nullptr, db, 100, kRead); thread->stats.FinishedOps(nullptr, db, 100, kRead);
...@@ -3860,7 +3863,8 @@ class Benchmark { ...@@ -3860,7 +3863,8 @@ class Benchmark {
if (thread->shared->read_rate_limiter.get() != nullptr && if (thread->shared->read_rate_limiter.get() != nullptr &&
read % 256 == 255) { read % 256 == 255) {
thread->shared->read_rate_limiter->Request(256, Env::IO_HIGH); thread->shared->read_rate_limiter->Request(256, Env::IO_HIGH,
nullptr /* stats */);
} }
thread->stats.FinishedOps(db_with_cfh, db_with_cfh->db, 1, kRead); thread->stats.FinishedOps(db_with_cfh, db_with_cfh->db, 1, kRead);
...@@ -3915,8 +3919,8 @@ class Benchmark { ...@@ -3915,8 +3919,8 @@ class Benchmark {
} }
if (thread->shared->read_rate_limiter.get() != nullptr && if (thread->shared->read_rate_limiter.get() != nullptr &&
num_multireads % 256 == 255) { num_multireads % 256 == 255) {
thread->shared->read_rate_limiter->Request(256 * entries_per_batch_, thread->shared->read_rate_limiter->Request(
Env::IO_HIGH); 256 * entries_per_batch_, Env::IO_HIGH, nullptr /* stats */);
} }
thread->stats.FinishedOps(nullptr, db, entries_per_batch_, kRead); thread->stats.FinishedOps(nullptr, db, entries_per_batch_, kRead);
} }
...@@ -4013,7 +4017,8 @@ class Benchmark { ...@@ -4013,7 +4017,8 @@ class Benchmark {
if (thread->shared->read_rate_limiter.get() != nullptr && if (thread->shared->read_rate_limiter.get() != nullptr &&
read % 256 == 255) { read % 256 == 255) {
thread->shared->read_rate_limiter->Request(256, Env::IO_HIGH); thread->shared->read_rate_limiter->Request(256, Env::IO_HIGH,
nullptr /* stats */);
} }
thread->stats.FinishedOps(&db_, db_.db, 1, kSeek); thread->stats.FinishedOps(&db_, db_.db, 1, kSeek);
...@@ -4143,8 +4148,8 @@ class Benchmark { ...@@ -4143,8 +4148,8 @@ class Benchmark {
if (FLAGS_benchmark_write_rate_limit > 0) { if (FLAGS_benchmark_write_rate_limit > 0) {
write_rate_limiter->Request( write_rate_limiter->Request(
entries_per_batch_ * (value_size_ + key_size_), entries_per_batch_ * (value_size_ + key_size_), Env::IO_HIGH,
Env::IO_HIGH); nullptr /* stats */);
} }
} }
thread->stats.AddBytes(bytes); thread->stats.AddBytes(bytes);
...@@ -4815,7 +4820,8 @@ class Benchmark { ...@@ -4815,7 +4820,8 @@ class Benchmark {
found += key_found; found += key_found;
if (thread->shared->read_rate_limiter.get() != nullptr) { if (thread->shared->read_rate_limiter.get() != nullptr) {
thread->shared->read_rate_limiter->Request(1, Env::IO_HIGH); thread->shared->read_rate_limiter->Request(1, Env::IO_HIGH,
nullptr /* stats */);
} }
} }
delete iter; delete iter;
...@@ -4885,7 +4891,8 @@ class Benchmark { ...@@ -4885,7 +4891,8 @@ class Benchmark {
if (FLAGS_benchmark_write_rate_limit > 0) { if (FLAGS_benchmark_write_rate_limit > 0) {
write_rate_limiter->Request( write_rate_limiter->Request(
entries_per_batch_ * (value_size_ + key_size_), Env::IO_HIGH); entries_per_batch_ * (value_size_ + key_size_), Env::IO_HIGH,
nullptr /* stats */);
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册