aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps/client.h
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2016-05-02 10:56:54 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2016-05-02 10:56:54 -0700
commit80721b20ca574df78e7e884a023425274e964a17 (patch)
tree3f18a170c1cdc49af7c48a787170a818eb2efa0f /test/cpp/qps/client.h
parent1b2db6333d4783e18b8d72db7893a758c4fcd2b9 (diff)
parent1dd74dd3783daa3ac427add91b3b81deb7758200 (diff)
Merge branch 'master' of github.com:grpc/grpc into codegen_remove_proto
Diffstat (limited to 'test/cpp/qps/client.h')
-rw-r--r--test/cpp/qps/client.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h
index 5a9027a4a2..175529f01b 100644
--- a/test/cpp/qps/client.h
+++ b/test/cpp/qps/client.h
@@ -39,6 +39,7 @@
#include <vector>
#include <grpc++/support/byte_buffer.h>
+#include <grpc++/support/channel_arguments.h>
#include <grpc++/support/slice.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
@@ -280,7 +281,7 @@ class ClientImpl : public Client {
create_stub_(create_stub) {
for (int i = 0; i < config.client_channels(); i++) {
channels_[i].init(config.server_targets(i % config.server_targets_size()),
- config, create_stub_);
+ config, create_stub_, i);
}
ClientRequestCreator<RequestType> create_req(&request_,
@@ -303,14 +304,17 @@ class ClientImpl : public Client {
}
void init(const grpc::string& target, const ClientConfig& config,
std::function<std::unique_ptr<StubType>(std::shared_ptr<Channel>)>
- create_stub) {
+ create_stub,
+ int shard) {
// We have to use a 2-phase init like this with a default
// constructor followed by an initializer function to make
// old compilers happy with using this in std::vector
+ ChannelArguments args;
+ args.SetInt("shard_to_ensure_no_subchannel_merges", shard);
channel_ = CreateTestChannel(
target, config.security_params().server_host_override(),
- config.has_security_params(),
- !config.security_params().use_test_ca());
+ config.has_security_params(), !config.security_params().use_test_ca(),
+ std::shared_ptr<CallCredentials>(), args);
stub_ = create_stub(channel_);
}
Channel* get_channel() { return channel_.get(); }