add some comments

pull/11000/head
Yuxuan Li 8 years ago
parent 5f9f37a33c
commit a33e2b27a1
  1. 1
      src/proto/grpc/testing/control.proto
  2. 2
      src/proto/grpc/testing/stats.proto
  3. 32
      test/cpp/microbenchmarks/fullstack_fixtures.h
  4. 5
      test/cpp/microbenchmarks/helpers.cc
  5. 2
      test/cpp/microbenchmarks/helpers.h
  6. 2
      test/cpp/qps/report.h

@ -242,6 +242,7 @@ message ScenarioResultSummary
double successful_requests_per_second = 13;
double failed_requests_per_second = 14;
// Number of polls called inside completion queue per request
double client_polls_per_request = 15;
double server_polls_per_request = 16;
}

@ -48,6 +48,7 @@ message ServerStats {
// change in idle time of the server (data from proc/stat)
uint64 idle_cpu_time = 5;
// Number of polls called inside completion queue
uint64 cq_poll_count = 6;
}
@ -84,5 +85,6 @@ message ClientStats {
// Number of failed requests (one row per status code seen)
repeated RequestResultCount request_results = 5;
// Number of polls called inside completion queue
uint64 cq_poll_count = 6;
}

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

@ -67,8 +67,3 @@ void TrackCounters::AddToLabel(std::ostream &out, benchmark::State &state) {
(double)state.iterations());
#endif
}
void TrackCounters::AppendToLabel(std::ostream &out, std::string metric,
double value) {
out << " " << key << ":" << value;
}

@ -80,8 +80,6 @@ class TrackCounters {
public:
virtual void Finish(benchmark::State& state);
virtual void AddToLabel(std::ostream& out, benchmark::State& state);
virtual void AppendToLabel(std::ostream& out, std::string metric,
double value);
private:
#ifdef GPR_LOW_LEVEL_COUNTERS

@ -76,7 +76,7 @@ class Reporter {
/** Reports server cpu usage. */
virtual void ReportCpuUsage(const ScenarioResult& result) = 0;
/** Reports server cpu usage. */
/** Reports client and server poll usage inside completion queue. */
virtual void ReportPollCount(const ScenarioResult& result) = 0;
private:

Loading…
Cancel
Save