aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/cpp')
-rw-r--r--test/cpp/qps/driver.cc6
-rw-r--r--test/cpp/qps/generic_async_streaming_ping_pong_test.cc2
-rw-r--r--test/cpp/qps/qps_driver.cc4
-rw-r--r--test/cpp/qps/qps_worker.cc24
-rw-r--r--test/cpp/qps/server.h1
-rw-r--r--test/cpp/qps/server_async.cc2
6 files changed, 34 insertions, 5 deletions
diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc
index acb265b308..66269ae757 100644
--- a/test/cpp/qps/driver.cc
+++ b/test/cpp/qps/driver.cc
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -161,6 +161,8 @@ std::unique_ptr<ScenarioResult> RunScenario(
// where class contained in std::vector must have a copy constructor
auto* servers = new ServerData[num_servers];
for (size_t i = 0; i < num_servers; i++) {
+ gpr_log(GPR_INFO, "Starting server on %s (worker #%d)", workers[i].c_str(),
+ i);
servers[i].stub = WorkerService::NewStub(
CreateChannel(workers[i], InsecureChannelCredentials()));
ServerArgs args;
@@ -188,6 +190,8 @@ std::unique_ptr<ScenarioResult> RunScenario(
// where class contained in std::vector must have a copy constructor
auto* clients = new ClientData[num_clients];
for (size_t i = 0; i < num_clients; i++) {
+ gpr_log(GPR_INFO, "Starting client on %s (worker #%d)",
+ workers[i + num_servers].c_str(), i + num_servers);
clients[i].stub = WorkerService::NewStub(
CreateChannel(workers[i + num_servers], InsecureChannelCredentials()));
ClientArgs args;
diff --git a/test/cpp/qps/generic_async_streaming_ping_pong_test.cc b/test/cpp/qps/generic_async_streaming_ping_pong_test.cc
index 2b2e1c820f..81c0f24103 100644
--- a/test/cpp/qps/generic_async_streaming_ping_pong_test.cc
+++ b/test/cpp/qps/generic_async_streaming_ping_pong_test.cc
@@ -60,7 +60,7 @@ static void RunGenericAsyncStreamingPingPong() {
bbuf->set_req_size(0);
ServerConfig server_config;
- server_config.set_server_type(ASYNC_SERVER);
+ server_config.set_server_type(ASYNC_GENERIC_SERVER);
server_config.set_host("localhost");
server_config.set_async_server_threads(1);
diff --git a/test/cpp/qps/qps_driver.cc b/test/cpp/qps/qps_driver.cc
index 9816a09592..680e4b19b9 100644
--- a/test/cpp/qps/qps_driver.cc
+++ b/test/cpp/qps/qps_driver.cc
@@ -153,7 +153,7 @@ static void QpsDriver() {
ServerConfig server_config;
server_config.set_server_type(server_type);
- server_config.set_host("localhost");
+ server_config.set_host("::"); // Use the wildcard server address
server_config.set_async_server_threads(FLAGS_async_server_threads);
if (FLAGS_secure_test) {
@@ -170,7 +170,7 @@ static void QpsDriver() {
GPR_ASSERT(!client_config.payload_config().has_bytebuf_params() ||
(client_config.client_type() == ASYNC_CLIENT &&
client_config.rpc_type() == STREAMING &&
- server_config.server_type() == ASYNC_SERVER));
+ server_config.server_type() == ASYNC_GENERIC_SERVER));
const auto result = RunScenario(
client_config, FLAGS_num_clients, server_config, FLAGS_num_servers,
diff --git a/test/cpp/qps/qps_worker.cc b/test/cpp/qps/qps_worker.cc
index c0276d05b3..6316605aaf 100644
--- a/test/cpp/qps/qps_worker.cc
+++ b/test/cpp/qps/qps_worker.cc
@@ -61,6 +61,11 @@ namespace grpc {
namespace testing {
static std::unique_ptr<Client> CreateClient(const ClientConfig& config) {
+ gpr_log(GPR_INFO, "Starting client of type %s %s %d",
+ ClientType_Name(config.client_type()).c_str(),
+ RpcType_Name(config.rpc_type()).c_str(),
+ config.payload_config().has_bytebuf_params());
+
switch (config.client_type()) {
case ClientType::SYNC_CLIENT:
return (config.rpc_type() == RpcType::UNARY)
@@ -81,6 +86,9 @@ static std::unique_ptr<Client> CreateClient(const ClientConfig& config) {
static void LimitCores(int cores) {}
static std::unique_ptr<Server> CreateServer(const ServerConfig& config) {
+ gpr_log(GPR_INFO, "Starting server of type %s",
+ ServerType_Name(config.server_type()).c_str());
+
if (config.core_limit() > 0) {
LimitCores(config.core_limit());
}
@@ -89,6 +97,8 @@ static std::unique_ptr<Server> CreateServer(const ServerConfig& config) {
return CreateSynchronousServer(config);
case ServerType::ASYNC_SERVER:
return CreateAsyncServer(config);
+ case ServerType::ASYNC_GENERIC_SERVER:
+ return CreateAsyncGenericServer(config);
default:
abort();
}
@@ -169,22 +179,29 @@ class WorkerServiceImpl GRPC_FINAL : public WorkerService::Service {
if (!args.has_setup()) {
return Status(StatusCode::INVALID_ARGUMENT, "");
}
+ gpr_log(GPR_INFO, "RunClientBody: about to create client");
auto client = CreateClient(args.setup());
if (!client) {
return Status(StatusCode::INVALID_ARGUMENT, "");
}
+ gpr_log(GPR_INFO, "RunClientBody: client created");
ClientStatus status;
if (!stream->Write(status)) {
return Status(StatusCode::UNKNOWN, "");
}
+ gpr_log(GPR_INFO, "RunClientBody: creation status reported");
while (stream->Read(&args)) {
+ gpr_log(GPR_INFO, "RunClientBody: Message read");
if (!args.has_mark()) {
+ gpr_log(GPR_INFO, "RunClientBody: Message is not a mark!");
return Status(StatusCode::INVALID_ARGUMENT, "");
}
*status.mutable_stats() = client->Mark(args.mark().reset());
stream->Write(status);
+ gpr_log(GPR_INFO, "RunClientBody: Mark response given");
}
+ gpr_log(GPR_INFO, "RunClientBody: Returning");
return Status::OK;
}
@@ -200,24 +217,31 @@ class WorkerServiceImpl GRPC_FINAL : public WorkerService::Service {
if (server_port_ != 0) {
args.mutable_setup()->set_port(server_port_);
}
+ gpr_log(GPR_INFO, "RunServerBody: about to create server");
auto server = CreateServer(args.setup());
if (!server) {
return Status(StatusCode::INVALID_ARGUMENT, "");
}
+ gpr_log(GPR_INFO, "RunServerBody: server created");
ServerStatus status;
status.set_port(server->port());
status.set_cores(server->cores());
if (!stream->Write(status)) {
return Status(StatusCode::UNKNOWN, "");
}
+ gpr_log(GPR_INFO, "RunServerBody: creation status reported");
while (stream->Read(&args)) {
+ gpr_log(GPR_INFO, "RunServerBody: Message read");
if (!args.has_mark()) {
+ gpr_log(GPR_INFO, "RunServerBody: Message not a mark!");
return Status(StatusCode::INVALID_ARGUMENT, "");
}
*status.mutable_stats() = server->Mark(args.mark().reset());
stream->Write(status);
+ gpr_log(GPR_INFO, "RunServerBody: Mark response given");
}
+ gpr_log(GPR_INFO, "RunServerBody: Returning");
return Status::OK;
}
diff --git a/test/cpp/qps/server.h b/test/cpp/qps/server.h
index 32a3e85026..196fdac8f3 100644
--- a/test/cpp/qps/server.h
+++ b/test/cpp/qps/server.h
@@ -108,6 +108,7 @@ class Server {
std::unique_ptr<Server> CreateSynchronousServer(const ServerConfig& config);
std::unique_ptr<Server> CreateAsyncServer(const ServerConfig& config);
+std::unique_ptr<Server> CreateAsyncGenericServer(const ServerConfig& config);
} // namespace testing
} // namespace grpc
diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc
index d530dac86b..cd8d546c28 100644
--- a/test/cpp/qps/server_async.cc
+++ b/test/cpp/qps/server_async.cc
@@ -373,7 +373,7 @@ static Status ProcessGenericRPC(const PayloadConfig &payload_config,
const ByteBuffer *request,
ByteBuffer *response) {
int resp_size = payload_config.bytebuf_params().resp_size();
- std::unique_ptr<char> buf(new char[resp_size]);
+ std::unique_ptr<char[]> buf(new char[resp_size]);
gpr_slice s = gpr_slice_from_copied_buffer(buf.get(), resp_size);
Slice slice(s, Slice::STEAL_REF);
*response = ByteBuffer(&slice, 1);