Skip to content
Snippets Groups Projects
Commit daf46996 authored by Craig Tiller's avatar Craig Tiller Committed by GitHub
Browse files

Merge pull request #6732 from ctiller/consistent_client_count

Make client_channels be across all clients, not per-client
parents df48291b 346da5f3
No related branches found
No related tags found
No related merge requests found
......@@ -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 =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment