diff --git a/monitoring/histogram.cc b/monitoring/histogram.cc index d2b7ff844..4970df7bd 100644 --- a/monitoring/histogram.cc +++ b/monitoring/histogram.cc @@ -202,6 +202,7 @@ std::string HistogramStat::ToString() const { Percentile(99.99)); r.append(buf); r.append("------------------------------------------------------\n"); + if (cur_num == 0) return r; // all buckets are empty const double mult = 100.0 / cur_num; uint64_t cumulative_sum = 0; for (unsigned int b = 0; b < num_buckets_; b++) {