From 6db722453fe10179c7a6cebfb6fe027caaae8381 Mon Sep 17 00:00:00 2001 From: vjpai Date: Tue, 21 Apr 2015 10:50:12 -0700 Subject: Clamp at 1.0 on low end to handle rare possibility of sub-1 microsecond --- src/core/support/histogram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/support/histogram.c b/src/core/support/histogram.c index ed344b43e8..673affde71 100644 --- a/src/core/support/histogram.c +++ b/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; } -- cgit v1.2.3