diff options
author | Yuxuan Li <yuxuanli@google.com> | 2017-05-03 21:36:36 -0700 |
---|---|---|
committer | Yuxuan Li <yuxuanli@google.com> | 2017-05-03 21:36:36 -0700 |
commit | 999ac157e648d6bccdec16a696842bdbf5416e27 (patch) | |
tree | 22664fa7ec5693abcf5b86dda05e3f51e64368e1 /test/cpp/microbenchmarks/fullstack_fixtures.h | |
parent | 12056f1a0cdd3c02ca0b7aeba34a1f72da40f6c9 (diff) |
initial implementation.
Diffstat (limited to 'test/cpp/microbenchmarks/fullstack_fixtures.h')
-rw-r--r-- | test/cpp/microbenchmarks/fullstack_fixtures.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/cpp/microbenchmarks/fullstack_fixtures.h b/test/cpp/microbenchmarks/fullstack_fixtures.h index 98aca1c346..cb96ac5d71 100644 --- a/test/cpp/microbenchmarks/fullstack_fixtures.h +++ b/test/cpp/microbenchmarks/fullstack_fixtures.h @@ -100,6 +100,17 @@ class FullstackFixture : public BaseFixture { } } + void Finish(benchmark::State &state) { + std::ostringstream out; + AddToLabel(out, state); + AppendToLabel(out, "polls/iter", (double)grpc_get_cq_poll_num(this->cq()->cq())/state.iterations()); + auto label = out.str(); + if (label.length() && label[0] == ' ') { + label = label.substr(1); + } + state.SetLabel(label); + } + ServerCompletionQueue* cq() { return cq_.get(); } std::shared_ptr<Channel> channel() { return channel_; } @@ -212,6 +223,17 @@ class EndpointPairFixture : public BaseFixture { } } + void Finish(benchmark::State &state) { + std::ostringstream out; + AddToLabel(out, state); + AppendToLabel(out, "polls/iter", (double)grpc_get_cq_poll_num(this->cq()->cq())/state.iterations()); + auto label = out.str(); + if (label.length() && label[0] == ' ') { + label = label.substr(1); + } + state.SetLabel(label); + } + ServerCompletionQueue* cq() { return cq_.get(); } std::shared_ptr<Channel> channel() { return channel_; } |