aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/microbenchmarks
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2018-08-10 06:11:40 +0000
committerGravatar Vijay Pai <vpai@google.com>2018-08-10 06:11:40 +0000
commit9043a4f56d899a377d8763fa868b277d23e7b213 (patch)
tree502da2d9e15fd907acdc2def070220b09df0067c /test/cpp/microbenchmarks
parent17e3611c0d5c55da1c7ae69f956e6024502edc25 (diff)
Some cleanup
Diffstat (limited to 'test/cpp/microbenchmarks')
-rw-r--r--test/cpp/microbenchmarks/bm_cq_multiple_threads.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
index 2f66a6d53e..4a5487f1c4 100644
--- a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
+++ b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
@@ -141,8 +141,9 @@ static void teardown() {
static void BM_Cq_Throughput(benchmark::State& state) {
TrackCounters track_counters;
gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC);
+ auto thd_idx = state.thread_index;
- if (state.thread_index == 0) {
+ if (thd_idx == 0) {
setup();
}
@@ -152,12 +153,11 @@ static void BM_Cq_Throughput(benchmark::State& state) {
}
state.SetItemsProcessed(state.iterations());
+ track_counters.Finish(state);
- if (state.thread_index == 0) {
+ if (thd_idx == 0) {
teardown();
}
-
- track_counters.Finish(state);
}
BENCHMARK(BM_Cq_Throughput)->ThreadRange(1, 16)->UseRealTime();