diff options
author | Yuxuan Li <yuxuanli@google.com> | 2016-11-15 13:31:36 -0800 |
---|---|---|
committer | Yuxuan Li <yuxuanli@google.com> | 2017-01-11 08:01:40 +0000 |
commit | 98c0bd7c829c4932ac12ebbe6687f0fc5380e866 (patch) | |
tree | 15c70a5d130ea9eef324904ee5d9e97a207717b3 /test/cpp/qps/client.h | |
parent | a3960b98d6a1b85a1e3b89cd7797a509505fa207 (diff) |
add setting channel args functionality to performance tesing
setting channel args --draft
clang-format
Diffstat (limited to 'test/cpp/qps/client.h')
-rw-r--r-- | test/cpp/qps/client.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h index fdd78ebb89..18f9778fc6 100644 --- a/test/cpp/qps/client.h +++ b/test/cpp/qps/client.h @@ -409,6 +409,7 @@ class ClientImpl : public Client { // old compilers happy with using this in std::vector ChannelArguments args; args.SetInt("shard_to_ensure_no_subchannel_merges", shard); + set_channel_args(config, &args); channel_ = CreateTestChannel( target, config.security_params().server_host_override(), config.has_security_params(), !config.security_params().use_test_ca(), @@ -423,6 +424,18 @@ class ClientImpl : public Client { StubType* get_stub() { return stub_.get(); } private: + void set_channel_args(const ClientConfig& config, ChannelArguments* args) { + for (auto channel_arg : config.channel_args()) { + if (channel_arg.value_case() == ChannelArg::kStrValue) { + args->SetString(channel_arg.name(), channel_arg.str_value()); + } else if (channel_arg.value_case() == ChannelArg::kIntValue) { + args->SetInt(channel_arg.name(), channel_arg.int_value()); + } else { + gpr_log(GPR_ERROR, "Empty channel arg value."); + } + } + } + std::shared_ptr<Channel> channel_; std::unique_ptr<StubType> stub_; }; |