diff options
author | Noah Eisen <ncteisen@gmail.com> | 2018-10-15 19:31:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-15 19:31:33 -0400 |
commit | a605af756862c3ff8413482af302e17afd36c658 (patch) | |
tree | 8747a74a6abafcc5e2328748cf8ea7e612ef6148 /test | |
parent | 302c89e047c5f812aec018854f2ea4c442ac42d1 (diff) | |
parent | 07ac7022095c9bf56daf5af9585ca08a49555e7a (diff) |
Merge pull request #16884 from ncteisen/stats
Only Print Stats if Collected
Diffstat (limited to 'test')
-rw-r--r-- | test/core/end2end/tests/simple_request.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/core/end2end/tests/simple_request.cc b/test/core/end2end/tests/simple_request.cc index 941d9ae319..9c018962f8 100644 --- a/test/core/end2end/tests/simple_request.cc +++ b/test/core/end2end/tests/simple_request.cc @@ -108,7 +108,9 @@ static void simple_request_body(grpc_end2end_test_config config, grpc_stats_data* after = static_cast<grpc_stats_data*>(gpr_malloc(sizeof(grpc_stats_data))); +#if defined(GRPC_COLLECT_STATS) || !defined(NDEBUG) grpc_stats_collect(before); +#endif /* defined(GRPC_COLLECT_STATS) || !defined(NDEBUG) */ gpr_timespec deadline = five_seconds_from_now(); c = grpc_channel_create_call(f.client, nullptr, GRPC_PROPAGATE_DEFAULTS, f.cq, @@ -225,17 +227,18 @@ static void simple_request_body(grpc_end2end_test_config config, cq_verifier_destroy(cqv); + int expected_calls = 1; + if (config.feature_mask & FEATURE_MASK_SUPPORTS_REQUEST_PROXYING) { + expected_calls *= 2; + } +#if defined(GRPC_COLLECT_STATS) || !defined(NDEBUG) + grpc_stats_collect(after); char* stats = grpc_stats_data_as_json(after); gpr_log(GPR_DEBUG, "%s", stats); gpr_free(stats); - int expected_calls = 1; - if (config.feature_mask & FEATURE_MASK_SUPPORTS_REQUEST_PROXYING) { - expected_calls *= 2; - } -#if defined(GRPC_COLLECT_STATS) || !defined(NDEBUG) GPR_ASSERT(after->counters[GRPC_STATS_COUNTER_CLIENT_CALLS_CREATED] - before->counters[GRPC_STATS_COUNTER_CLIENT_CALLS_CREATED] == expected_calls); |