diff options
author | 2018-02-09 09:34:04 -0800 | |
---|---|---|
committer | 2018-02-09 09:34:04 -0800 | |
commit | 4d20a666850b732cf1562487fb5f46ab9654105f (patch) | |
tree | 9059162d0f125e02780f506c2476d5d9bbc0eb7d /test/cpp/microbenchmarks | |
parent | cddf6f838aa48c8d5c9f75cee5a8ed8abdcb25b9 (diff) |
Run clang fmt
Diffstat (limited to 'test/cpp/microbenchmarks')
-rw-r--r-- | test/cpp/microbenchmarks/bm_chttp2_hpack.cc | 3 | ||||
-rw-r--r-- | test/cpp/microbenchmarks/bm_cq_multiple_threads.cc | 5 | ||||
-rw-r--r-- | test/cpp/microbenchmarks/fullstack_fixtures.h | 6 | ||||
-rw-r--r-- | test/cpp/microbenchmarks/helpers.cc | 15 |
4 files changed, 18 insertions, 11 deletions
diff --git a/test/cpp/microbenchmarks/bm_chttp2_hpack.cc b/test/cpp/microbenchmarks/bm_chttp2_hpack.cc index 3fe709ff83..07bb3c92ae 100644 --- a/test/cpp/microbenchmarks/bm_chttp2_hpack.cc +++ b/test/cpp/microbenchmarks/bm_chttp2_hpack.cc @@ -777,7 +777,8 @@ static void OnHeaderNew(void* user_data, grpc_mdelem md) { if (GRPC_MDELEM_IS_INTERNED(md)) { /* not already parsed: parse it now, and store the * result away */ - cached_timeout = static_cast<grpc_millis*>(gpr_malloc(sizeof(grpc_millis))); + cached_timeout = + static_cast<grpc_millis*>(gpr_malloc(sizeof(grpc_millis))); *cached_timeout = timeout; grpc_mdelem_set_user_data(md, free_timeout, cached_timeout); } diff --git a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc index 7b236d94b6..ec79b95cd8 100644 --- a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc +++ b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc @@ -74,8 +74,9 @@ static grpc_error* pollset_work(grpc_pollset* ps, grpc_pollset_worker** worker, gpr_mu_unlock(&ps->mu); GPR_ASSERT(grpc_cq_begin_op(g_cq, g_tag)); - grpc_cq_end_op(g_cq, g_tag, GRPC_ERROR_NONE, cq_done_cb, nullptr, - static_cast<grpc_cq_completion*>(gpr_malloc(sizeof(grpc_cq_completion)))); + grpc_cq_end_op( + g_cq, g_tag, GRPC_ERROR_NONE, cq_done_cb, nullptr, + static_cast<grpc_cq_completion*>(gpr_malloc(sizeof(grpc_cq_completion)))); grpc_core::ExecCtx::Get()->Flush(); gpr_mu_lock(&ps->mu); return GRPC_ERROR_NONE; diff --git a/test/cpp/microbenchmarks/fullstack_fixtures.h b/test/cpp/microbenchmarks/fullstack_fixtures.h index ce9731b7a6..ab6c194830 100644 --- a/test/cpp/microbenchmarks/fullstack_fixtures.h +++ b/test/cpp/microbenchmarks/fullstack_fixtures.h @@ -108,7 +108,8 @@ class FullstackFixture : public BaseFixture { void AddToLabel(std::ostream& out, benchmark::State& state) { BaseFixture::AddToLabel(out, state); out << " polls/iter:" - << static_cast<double>(grpc_get_cq_poll_num(this->cq()->cq())) / state.iterations(); + << static_cast<double>(grpc_get_cq_poll_num(this->cq()->cq())) / + state.iterations(); } ServerCompletionQueue* cq() { return cq_.get(); } @@ -236,7 +237,8 @@ class EndpointPairFixture : public BaseFixture { void AddToLabel(std::ostream& out, benchmark::State& state) { BaseFixture::AddToLabel(out, state); out << " polls/iter:" - << static_cast<double>(grpc_get_cq_poll_num(this->cq()->cq())) / state.iterations(); + << static_cast<double>(grpc_get_cq_poll_num(this->cq()->cq())) / + state.iterations(); } ServerCompletionQueue* cq() { return cq_.get(); } diff --git a/test/cpp/microbenchmarks/helpers.cc b/test/cpp/microbenchmarks/helpers.cc index 25a033f104..e4a31f50a9 100644 --- a/test/cpp/microbenchmarks/helpers.cc +++ b/test/cpp/microbenchmarks/helpers.cc @@ -43,18 +43,21 @@ void TrackCounters::AddToLabel(std::ostream& out, benchmark::State& state) { grpc_stats_data stats; grpc_stats_diff(&stats_end, &stats_begin_, &stats); for (int i = 0; i < GRPC_STATS_COUNTER_COUNT; i++) { - out << " " << grpc_stats_counter_name[i] - << "/iter:" << (static_cast<double>(stats.counters[i]) / static_cast<double>(state.iterations())); + out << " " << grpc_stats_counter_name[i] << "/iter:" + << (static_cast<double>(stats.counters[i]) / + static_cast<double>(state.iterations())); } for (int i = 0; i < GRPC_STATS_HISTOGRAM_COUNT; i++) { std::ostringstream median_ss; median_ss << grpc_stats_histogram_name[i] << "-median"; - state.counters[median_ss.str()] = benchmark::Counter( - grpc_stats_histo_percentile(&stats, static_cast<grpc_stats_histograms>(i), 50.0)); + state.counters[median_ss.str()] = + benchmark::Counter(grpc_stats_histo_percentile( + &stats, static_cast<grpc_stats_histograms>(i), 50.0)); std::ostringstream tail_ss; tail_ss << grpc_stats_histogram_name[i] << "-99p"; - state.counters[tail_ss.str()] = benchmark::Counter( - grpc_stats_histo_percentile(&stats, static_cast<grpc_stats_histograms>(i), 99.0)); + state.counters[tail_ss.str()] = + benchmark::Counter(grpc_stats_histo_percentile( + &stats, static_cast<grpc_stats_histograms>(i), 99.0)); } #ifdef GPR_LOW_LEVEL_COUNTERS grpc_memory_counters counters_at_end = grpc_memory_counters_snapshot(); |