|
|
@ -100,17 +100,10 @@ class FullstackFixture : public BaseFixture { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Finish(benchmark::State& state) { |
|
|
|
void AddToLabel(std::ostream& out, benchmark::State& state) { |
|
|
|
std::ostringstream out; |
|
|
|
BaseFixture::AddToLabel(out, state); |
|
|
|
AddToLabel(out, state); |
|
|
|
out << " polls/iter:" |
|
|
|
AppendToLabel( |
|
|
|
<< (double)grpc_get_cq_poll_num(this->cq()->cq()) / state.iterations(); |
|
|
|
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(); } |
|
|
|
ServerCompletionQueue* cq() { return cq_.get(); } |
|
|
@ -225,17 +218,10 @@ class EndpointPairFixture : public BaseFixture { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Finish(benchmark::State& state) { |
|
|
|
void AddToLabel(std::ostream& out, benchmark::State& state) { |
|
|
|
std::ostringstream out; |
|
|
|
BaseFixture::AddToLabel(out, state); |
|
|
|
AddToLabel(out, state); |
|
|
|
out << " polls/iter:" |
|
|
|
AppendToLabel( |
|
|
|
<< (double)grpc_get_cq_poll_num(this->cq()->cq()) / state.iterations(); |
|
|
|
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(); } |
|
|
|
ServerCompletionQueue* cq() { return cq_.get(); } |
|
|
@ -271,7 +257,7 @@ class InProcessCHTTP2 : public EndpointPairFixture { |
|
|
|
void AddToLabel(std::ostream& out, benchmark::State& state) { |
|
|
|
void AddToLabel(std::ostream& out, benchmark::State& state) { |
|
|
|
EndpointPairFixture::AddToLabel(out, state); |
|
|
|
EndpointPairFixture::AddToLabel(out, state); |
|
|
|
out << " writes/iter:" |
|
|
|
out << " writes/iter:" |
|
|
|
<< ((double)stats_.num_writes / (double)state.iterations()); |
|
|
|
<< (double)stats_.num_writes / (double)state.iterations(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|