aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2016-08-24 18:22:24 -0700
committerGravatar Yuchen Zeng <zyc@google.com>2016-08-24 18:22:24 -0700
commit78cc066db2a2c8d65f63826f9f76f81c16d63b03 (patch)
tree12b5a169bd6b967ebcee2226d5b93f69bcb03609 /test/cpp
parent4dd1891665024d98b6655326f0c6277793b9b055 (diff)
parent19ea0cffd7ba3df686ed05671f9ed35b8e9fa830 (diff)
Merge remote-tracking branch 'upstream/master' into cares_buildin
Diffstat (limited to 'test/cpp')
-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 2aeaea51f2..93f9271553 100644
--- a/test/cpp/qps/driver.cc
+++ b/test/cpp/qps/driver.cc
@@ -310,6 +310,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 ")",
@@ -345,6 +346,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 =