aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp
diff options
context:
space:
mode:
authorGravatar Noah Eisen <ncteisen@google.com>2018-09-17 14:15:56 -0700
committerGravatar Noah Eisen <ncteisen@google.com>2018-09-17 15:15:05 -0700
commitc33ec79cd8d748e84c87d0000b81adc15d202470 (patch)
treed51311c8adb7c990c042993c548240bf81dc1989 /test/cpp
parent14610176e3b34e0459b84e8e8d7e6f9e4ea0fa29 (diff)
Only output stats if they were collected
Diffstat (limited to 'test/cpp')
-rw-r--r--test/cpp/microbenchmarks/helpers.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/cpp/microbenchmarks/helpers.cc b/test/cpp/microbenchmarks/helpers.cc
index e4ba37e2d6..bce72985dc 100644
--- a/test/cpp/microbenchmarks/helpers.cc
+++ b/test/cpp/microbenchmarks/helpers.cc
@@ -38,6 +38,7 @@ void TrackCounters::AddLabel(const grpc::string& label) {
}
void TrackCounters::AddToLabel(std::ostream& out, benchmark::State& state) {
+#ifdef GRPC_COLLECT_STATS
grpc_stats_data stats_end;
grpc_stats_collect(&stats_end);
grpc_stats_data stats;
@@ -53,6 +54,7 @@ void TrackCounters::AddToLabel(std::ostream& out, benchmark::State& state) {
<< " " << grpc_stats_histogram_name[i] << "-99p:"
<< grpc_stats_histo_percentile(&stats, (grpc_stats_histograms)i, 99.0);
}
+#endif
#ifdef GPR_LOW_LEVEL_COUNTERS
grpc_memory_counters counters_at_end = grpc_memory_counters_snapshot();
out << " locks/iter:"