aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Sree Kuchibhotla <sreek@google.com>2017-02-03 20:41:00 -0800
committerGravatar Sree Kuchibhotla <sreek@google.com>2017-02-03 20:41:00 -0800
commit0b26e27056053f7e9651f849befdb466b96bea6e (patch)
tree7dbc44d7abde4c76d370aa015cb551363c6208f3
parentafaa75196e5f4098c60181020d307d72f1a580be (diff)
cr comments
-rw-r--r--test/cpp/microbenchmarks/bm_fullstack.cc13
1 files changed, 3 insertions, 10 deletions
diff --git a/test/cpp/microbenchmarks/bm_fullstack.cc b/test/cpp/microbenchmarks/bm_fullstack.cc
index e9259e154a..4981f5e27e 100644
--- a/test/cpp/microbenchmarks/bm_fullstack.cc
+++ b/test/cpp/microbenchmarks/bm_fullstack.cc
@@ -491,8 +491,7 @@ static void BM_StreamingPingPong(benchmark::State& state) {
}
// Send 'max_ping_pongs' number of ping pong messages
- int ping_pong_cnt = 0;
- while (ping_pong_cnt < max_ping_pongs) {
+ while (state.iterations() < max_ping_pongs) {
request_rw->Write(send_request, tag(0)); // Start client send
response_rw.Read(&recv_request, tag(1)); // Start server recv
request_rw->Read(&recv_response, tag(2)); // Start client recv
@@ -511,8 +510,6 @@ static void BM_StreamingPingPong(benchmark::State& state) {
GPR_ASSERT(need_tags & (1 << i));
need_tags &= ~(1 << i);
}
-
- ping_pong_cnt++;
}
request_rw->WritesDone(tag(0));
@@ -543,7 +540,6 @@ static void BM_StreamingPingPong(benchmark::State& state) {
template <class Fixture, class ClientContextMutator, class ServerContextMutator>
static void BM_StreamingPingPongMsgs(benchmark::State& state) {
const int msg_size = state.range(0);
- int ping_pong_cnt = 0;
EchoTestService::AsyncService service;
std::unique_ptr<Fixture> fixture(new Fixture(&service));
@@ -602,8 +598,6 @@ static void BM_StreamingPingPongMsgs(benchmark::State& state) {
GPR_ASSERT(need_tags & (1 << i));
need_tags &= ~(1 << i);
}
-
- ping_pong_cnt++;
}
request_rw->WritesDone(tag(0));
@@ -624,7 +618,7 @@ static void BM_StreamingPingPongMsgs(benchmark::State& state) {
fixture->Finish(state);
fixture.reset();
- state.SetBytesProcessed(msg_size * state.iterations() * ping_pong_cnt * 2);
+ state.SetBytesProcessed(msg_size * state.iterations() * 2);
}
template <class Fixture>
@@ -835,8 +829,7 @@ BENCHMARK_TEMPLATE(BM_PumpStreamServerToClient, InProcessCHTTP2)
static void StreamingPingPongArgs(benchmark::internal::Benchmark* b) {
int msg_size = 0;
int num_ping_pongs = 0;
- for (msg_size = 0; msg_size <= 128 * 1024 * 1024;
- msg_size == 0 ? msg_size++ : msg_size *= 8) {
+ for (msg_size = 1; msg_size <= 128 * 1024 * 1024; msg_size *= 8) {
for (num_ping_pongs = 0; num_ping_pongs <= 2; num_ping_pongs++) {
b->Args({msg_size, num_ping_pongs});
}