Only output stats if they were collected

pull/16641/head
Noah Eisen 6 years ago
parent 14610176e3
commit c33ec79cd8
  1. 2
      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:"

Loading…
Cancel
Save