aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/interop/metrics_client.cc
diff options
context:
space:
mode:
authorGravatar Sree Kuchibhotla <sreek@google.com>2015-11-16 11:52:54 -0800
committerGravatar Sree Kuchibhotla <sreek@google.com>2015-11-16 14:41:04 -0800
commitb047c0fc9b455e6cbfd1d6b080e9bb427282b670 (patch)
tree6c8bd8598bfe51607fda1f7c92e5e04ee9de096b /test/cpp/interop/metrics_client.cc
parentc36b480ce9354daaaf829de88a0a04e76873df7a (diff)
Address code review comments
Diffstat (limited to 'test/cpp/interop/metrics_client.cc')
-rw-r--r--test/cpp/interop/metrics_client.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/cpp/interop/metrics_client.cc b/test/cpp/interop/metrics_client.cc
index a1def7299a..d68bf6d667 100644
--- a/test/cpp/interop/metrics_client.cc
+++ b/test/cpp/interop/metrics_client.cc
@@ -67,9 +67,13 @@ void PrintMetrics(grpc::string& server_address) {
long overall_qps = 0;
int idx = 0;
while (reader->Read(&gauge_response)) {
- gpr_log(GPR_INFO, "Gauge: %d (%s: %ld)", ++idx,
- gauge_response.name().c_str(), gauge_response.value());
- overall_qps += gauge_response.value();
+ if (gauge_response.value_case() == GaugeResponse::kLongValue) {
+ gpr_log(GPR_INFO, "Gauge: %d (%s: %ld)", ++idx,
+ gauge_response.name().c_str(), gauge_response.long_value());
+ overall_qps += gauge_response.long_value();
+ } else {
+ gpr_log(GPR_INFO, "Gauge %s is not a long value", gauge_response.name().c_str());
+ }
}
gpr_log(GPR_INFO, "OVERALL: %ld", overall_qps);
@@ -84,7 +88,7 @@ int main(int argc, char** argv) {
grpc::testing::InitTest(&argc, &argv, true);
// Make sure server_addresses flag is not empty
- if (FLAGS_metrics_server_address.length() == 0) {
+ if (FLAGS_metrics_server_address.empty()) {
gpr_log(
GPR_ERROR,
"Cannot connect to the Metrics server. Please pass the address of the"