diff --git a/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/statistic/base/LeapArray.java b/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/statistic/base/LeapArray.java index 2bba544b..32b854e8 100755 --- a/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/statistic/base/LeapArray.java +++ b/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/statistic/base/LeapArray.java @@ -43,6 +43,7 @@ public abstract class LeapArray { protected int windowLengthInMs; protected int sampleCount; protected int intervalInMs; + private double intervalInSecond; protected final AtomicReferenceArray> array; @@ -64,6 +65,7 @@ public abstract class LeapArray { this.windowLengthInMs = intervalInMs / sampleCount; this.intervalInMs = intervalInMs; + this.intervalInSecond = intervalInMs / 1000.0; this.sampleCount = sampleCount; this.array = new AtomicReferenceArray<>(sampleCount); @@ -393,7 +395,7 @@ public abstract class LeapArray { * @return interval in second */ public double getIntervalInSecond() { - return intervalInMs / 1000.0; + return intervalInSecond; } public void debug(long time) {