aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps/driver.cc
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-08-22 11:39:08 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-08-22 11:39:08 -0700
commit8ef0eda856a52cc549b0f83c5836fe6fc22482f8 (patch)
treee8f78bd79dcf8419c9e4f132b7b9fdb32d5befe2 /test/cpp/qps/driver.cc
parentb2176fcadc7a01e09ff1a44fc23b2b236c174821 (diff)
parentdaf46996529a983013892344803539e9ae888f24 (diff)
Merge github.com:grpc/grpc into merge-parse
Diffstat (limited to 'test/cpp/qps/driver.cc')
-rw-r--r--test/cpp/qps/driver.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc
index 7db99629d4..969d5c6d7b 100644
--- a/test/cpp/qps/driver.cc
+++ b/test/cpp/qps/driver.cc
@@ -311,6 +311,7 @@ std::unique_ptr<ScenarioResult> RunScenario(
// clients is array rather than std::vector to avoid gcc-4.4 issues
// where class contained in std::vector must have a copy constructor
auto* clients = new ClientData[num_clients];
+ size_t channels_allocated = 0;
for (size_t i = 0; i < num_clients; i++) {
const auto& worker = workers[i + num_servers];
gpr_log(GPR_INFO, "Starting client on %s (worker #%" PRIuPTR ")",
@@ -346,6 +347,16 @@ std::unique_ptr<ScenarioResult> RunScenario(
}
}
+ // Reduce channel count so that total channels specified is held regardless
+ // of the number of clients available
+ size_t num_channels =
+ (client_config.client_channels() - channels_allocated) /
+ (num_clients - i);
+ channels_allocated += num_channels;
+ gpr_log(GPR_DEBUG, "Client %" PRIdPTR " gets %" PRIdPTR " channels", i,
+ num_channels);
+ per_client_config.set_client_channels(num_channels);
+
ClientArgs args;
*args.mutable_setup() = per_client_config;
clients[i].stream =