aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps
diff options
context:
space:
mode:
authorGravatar Alexander Polcyn <apolcyn@google.com>2018-07-24 14:13:27 -0700
committerGravatar Alexander Polcyn <apolcyn@google.com>2018-07-24 14:44:47 -0700
commitef29e14e1356bd7f8620b03e93c3dee7d83efaad (patch)
tree472e423cd27a6e31e3aaff4227300811a617a74e /test/cpp/qps
parent3fd42677776ac03b2be4ebaf27e8fb0d4c589ac0 (diff)
Use test credentials provider for QPS benchmarking reporter client
Diffstat (limited to 'test/cpp/qps')
-rw-r--r--test/cpp/qps/benchmark_config.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/cpp/qps/benchmark_config.cc b/test/cpp/qps/benchmark_config.cc
index a4fd9de820..5fd0f00038 100644
--- a/test/cpp/qps/benchmark_config.cc
+++ b/test/cpp/qps/benchmark_config.cc
@@ -22,6 +22,8 @@
#include <grpcpp/create_channel.h>
#include <grpcpp/security/credentials.h>
+#include "test/cpp/util/test_credentials_provider.h"
+
DEFINE_bool(enable_log_reporter, true,
"Enable reporting of benchmark results through GprLog");
@@ -44,6 +46,10 @@ DEFINE_string(rpc_reporter_server_address, "",
DEFINE_bool(enable_rpc_reporter, false, "Enable use of RPC reporter");
+DEFINE_string(
+ rpc_reporter_credential_type, grpc::testing::kInsecureCredentialsType,
+ "Credential type for communication to the QPS benchmark report server");
+
// In some distros, gflags is in the namespace google, and in some others,
// in gflags. This hack is enabling us to find both.
namespace google {}
@@ -65,11 +71,14 @@ static std::shared_ptr<Reporter> InitBenchmarkReporters() {
new JsonReporter("JsonReporter", FLAGS_scenario_result_file)));
}
if (FLAGS_enable_rpc_reporter) {
+ ChannelArguments channel_args;
+ std::shared_ptr<ChannelCredentials> channel_creds =
+ testing::GetCredentialsProvider()->GetChannelCredentials(
+ FLAGS_rpc_reporter_credential_type, &channel_args);
GPR_ASSERT(!FLAGS_rpc_reporter_server_address.empty());
composite_reporter->add(std::unique_ptr<Reporter>(new RpcReporter(
- "RpcReporter",
- grpc::CreateChannel(FLAGS_rpc_reporter_server_address,
- grpc::InsecureChannelCredentials()))));
+ "RpcReporter", grpc::CreateChannel(FLAGS_rpc_reporter_server_address,
+ channel_creds))));
}
return std::shared_ptr<Reporter>(composite_reporter);