From c4cd610528473a70c57c773c4b7046debd537ed1 Mon Sep 17 00:00:00 2001 From: Matt Jacobs Date: Wed, 26 Oct 2016 20:33:09 -0700 Subject: [PATCH] Clear the percentile snapshot whenever all buckets get cleared --- .../com/netflix/hystrix/util/HystrixRollingPercentile.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hystrix-core/src/main/java/com/netflix/hystrix/util/HystrixRollingPercentile.java b/hystrix-core/src/main/java/com/netflix/hystrix/util/HystrixRollingPercentile.java index faf17a844..8ab1ade44 100644 --- a/hystrix-core/src/main/java/com/netflix/hystrix/util/HystrixRollingPercentile.java +++ b/hystrix-core/src/main/java/com/netflix/hystrix/util/HystrixRollingPercentile.java @@ -308,6 +308,9 @@ public void reset() { // clear buckets so we start over again buckets.clear(); + + // and also make sure the percentile snapshot gets reset + currentPercentileSnapshot = new PercentileSnapshot(buckets.getArray()); } /* package-private for testing */ static class PercentileBucketData {