Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 91307d4

Browse files
committed
Small optimization
1 parent e55f3ce commit 91307d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/dev/failsafe/internal/TimedCircuitStats.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ class TimedCircuitStats implements CircuitStats {
3737
public TimedCircuitStats(int bucketCount, Duration thresholdingPeriod, Clock clock, CircuitStats oldStats) {
3838
this.clock = clock;
3939
this.buckets = new Bucket[bucketCount];
40+
windowSizeMillis = thresholdingPeriod.toMillis();
4041
bucketSizeMillis = thresholdingPeriod.toMillis() / buckets.length;
41-
windowSizeMillis = bucketSizeMillis * buckets.length;
4242
for (int i = 0; i < buckets.length; i++)
4343
buckets[i] = new Bucket();
4444
this.summary = new Stat();

0 commit comments

Comments
 (0)