Clamp at 1.0 on low end to handle rare possibility of sub-1 microsecond

pull/1328/head
vjpai 10 years ago
parent c6f60ead70
commit 6db722453f
  1. 2
      src/core/support/histogram.c

@ -76,7 +76,7 @@ static size_t bucket_for_unchecked(gpr_histogram *h, double x) {
/* bounds checked version of the above */
static size_t bucket_for(gpr_histogram *h, double x) {
size_t bucket = bucket_for_unchecked(h, GPR_CLAMP(x, 0, h->max_possible));
size_t bucket = bucket_for_unchecked(h, GPR_CLAMP(x, 1.0, h->max_possible));
GPR_ASSERT(bucket < h->num_buckets);
return bucket;
}

Loading…
Cancel
Save