aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps
diff options
context:
space:
mode:
authorGravatar Yuxuan Li <yuxuanli@google.com>2017-05-03 22:50:56 -0700
committerGravatar Yuxuan Li <yuxuanli@google.com>2017-05-03 22:50:56 -0700
commit28efff3e1e3d969f343bd1075039ce25d7834682 (patch)
treecfe74227924ea6e4aca7d1f3e136c4585d687968 /test/cpp/qps
parent5d3ddeeea1dc88392cfb126ebd5b86185c2d36cc (diff)
clang-format
Diffstat (limited to 'test/cpp/qps')
-rw-r--r--test/cpp/qps/client.h3
-rw-r--r--test/cpp/qps/client_async.cc18
-rw-r--r--test/cpp/qps/driver.cc12
-rw-r--r--test/cpp/qps/server.h3
-rw-r--r--test/cpp/qps/server_async.cc5
5 files changed, 24 insertions, 17 deletions
diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h
index 92c6c7a3a3..173f5ab0c4 100644
--- a/test/cpp/qps/client.h
+++ b/test/cpp/qps/client.h
@@ -198,7 +198,8 @@ class Client {
stats.set_time_elapsed(timer_result.wall);
stats.set_time_system(timer_result.system);
stats.set_time_user(timer_result.user);
- gpr_log(GPR_INFO, "*****poll count : %d %d %d", GetPollCount(), last_reset_poll_count_, last_reset_poll_count_to_use);
+ gpr_log(GPR_INFO, "*****poll count : %d %d %d", GetPollCount(),
+ last_reset_poll_count_, last_reset_poll_count_to_use);
stats.set_cq_poll_count(GetPollCount() - last_reset_poll_count_to_use);
return stats;
diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc
index 2e4b7acba7..49f9b5ca40 100644
--- a/test/cpp/qps/client_async.cc
+++ b/test/cpp/qps/client_async.cc
@@ -209,16 +209,16 @@ class AsyncClient : public ClientImpl<StubType, RequestType> {
}
}
-int GetPollCount() {
- int count = 0;
- int i = 0;
- for (auto cq = cli_cqs_.begin(); cq != cli_cqs_.end(); cq++) {
- int k = (int)grpc_get_cq_poll_num((*cq)->cq());
- gpr_log(GPR_INFO, "%d: per cq poll:%d", i++, k);
- count += k;
+ int GetPollCount() {
+ int count = 0;
+ // int i = 0;
+ for (auto cq = cli_cqs_.begin(); cq != cli_cqs_.end(); cq++) {
+ int k = (int)grpc_get_cq_poll_num((*cq)->cq());
+ // gpr_log(GPR_INFO, "%d: per cq poll:%d", i++, k);
+ count += k;
+ }
+ return count;
}
- return count;
-}
protected:
const int num_async_threads_;
diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc
index 24e9f730af..c41dcaa914 100644
--- a/test/cpp/qps/driver.cc
+++ b/test/cpp/qps/driver.cc
@@ -182,10 +182,14 @@ static void postprocess_scenario_result(ScenarioResult* result) {
result->mutable_summary()->set_failed_requests_per_second(failures /
time_estimate);
}
- gpr_log(GPR_INFO, "client poll count : %f", sum(result->client_stats(), CliPollCount));
- result->mutable_summary()->set_client_polls_per_request(sum(result->client_stats(), CliPollCount)/histogram.Count());
- gpr_log(GPR_INFO, "server poll count : %f", sum(result->server_stats(), SvrPollCount));
- result->mutable_summary()->set_server_polls_per_request(sum(result->server_stats(), SvrPollCount)/histogram.Count());
+ gpr_log(GPR_INFO, "client poll count : %f",
+ sum(result->client_stats(), CliPollCount));
+ result->mutable_summary()->set_client_polls_per_request(
+ sum(result->client_stats(), CliPollCount) / histogram.Count());
+ gpr_log(GPR_INFO, "server poll count : %f",
+ sum(result->server_stats(), SvrPollCount));
+ result->mutable_summary()->set_server_polls_per_request(
+ sum(result->server_stats(), SvrPollCount) / histogram.Count());
}
std::unique_ptr<ScenarioResult> RunScenario(
diff --git a/test/cpp/qps/server.h b/test/cpp/qps/server.h
index 5d5d5ffe09..e9951564cb 100644
--- a/test/cpp/qps/server.h
+++ b/test/cpp/qps/server.h
@@ -49,7 +49,8 @@ namespace testing {
class Server {
public:
- explicit Server(const ServerConfig& config) : timer_(new UsageTimer), last_reset_poll_count_(0) {
+ explicit Server(const ServerConfig& config)
+ : timer_(new UsageTimer), last_reset_poll_count_(0) {
cores_ = gpr_cpu_num_cores();
if (config.port()) {
port_ = config.port();
diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc
index e503e62204..4bd7af3d2d 100644
--- a/test/cpp/qps/server_async.cc
+++ b/test/cpp/qps/server_async.cc
@@ -160,14 +160,15 @@ class AsyncQpsServerTest final : public grpc::testing::Server {
int GetPollCount() {
int count = 0;
- int i = 0;
+ // int i = 0;
for (auto cq = srv_cqs_.begin(); cq != srv_cqs_.end(); cq++) {
int k = (int)grpc_get_cq_poll_num((*cq)->cq());
- gpr_log(GPR_INFO, "%d: per cq poll:%d", i++, k);
+ // gpr_log(GPR_INFO, "%d: per cq poll:%d", i++, k);
count += k;
}
return count;
}
+
private:
void ShutdownThreadFunc() {
// TODO (vpai): Remove this deadline and allow Shutdown to finish properly