aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/microbenchmarks/bm_call_create.cc
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-03-09 10:07:00 -0800
committerGravatar GitHub <noreply@github.com>2017-03-09 10:07:00 -0800
commit8d7ce8cc9ddfad0d629f8419d3a0f254f353224e (patch)
tree224df514985b6bacbd82b09be863ddda1fe1899d /test/cpp/microbenchmarks/bm_call_create.cc
parent7375d53de7e65ae15b320dd7b0f70d9ce2f5aae6 (diff)
parent2d42debc5a4be49f1339c4f4300906efc60105e2 (diff)
Merge pull request #10070 from ctiller/fmac
Redo bm_fullstack split, fixing mac build
Diffstat (limited to 'test/cpp/microbenchmarks/bm_call_create.cc')
-rw-r--r--test/cpp/microbenchmarks/bm_call_create.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/cpp/microbenchmarks/bm_call_create.cc b/test/cpp/microbenchmarks/bm_call_create.cc
index e2e5bbbe00..f25bcd2df8 100644
--- a/test/cpp/microbenchmarks/bm_call_create.cc
+++ b/test/cpp/microbenchmarks/bm_call_create.cc
@@ -55,12 +55,10 @@ extern "C" {
#include "src/core/lib/transport/transport_impl.h"
}
+#include "test/cpp/microbenchmarks/helpers.h"
#include "third_party/benchmark/include/benchmark/benchmark.h"
-static struct Init {
- Init() { grpc_init(); }
- ~Init() { grpc_shutdown(); }
-} g_init;
+auto &force_library_initialization = Library::get();
class BaseChannelFixture {
public:
@@ -89,6 +87,7 @@ class LameChannel : public BaseChannelFixture {
template <class Fixture>
static void BM_CallCreateDestroy(benchmark::State &state) {
+ TrackCounters track_counters;
Fixture fixture;
grpc_completion_queue *cq = grpc_completion_queue_create(NULL);
gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC);
@@ -100,6 +99,7 @@ static void BM_CallCreateDestroy(benchmark::State &state) {
deadline, NULL));
}
grpc_completion_queue_destroy(cq);
+ track_counters.Finish(state);
}
BENCHMARK_TEMPLATE(BM_CallCreateDestroy, InsecureChannel);
@@ -316,6 +316,7 @@ class SendEmptyMetadata {
// perform on said filter.
template <class Fixture, class TestOp>
static void BM_IsolatedFilter(benchmark::State &state) {
+ TrackCounters track_counters;
Fixture fixture;
std::ostringstream label;
@@ -371,6 +372,7 @@ static void BM_IsolatedFilter(benchmark::State &state) {
gpr_free(call_stack);
state.SetLabel(label.str());
+ track_counters.Finish(state);
}
typedef Fixture<nullptr, 0> NoFilter;