diff --git a/core/java/src/net/i2p/stat/Rate.java b/core/java/src/net/i2p/stat/Rate.java index 1d7fae51b64d8e3a77399e518edb41b63d7d3e52..25508263f01629bcc576e24a756b4bd14e2824f9 100644 --- a/core/java/src/net/i2p/stat/Rate.java +++ b/core/java/src/net/i2p/stat/Rate.java @@ -180,12 +180,14 @@ public class Rate { } } + /** 2s is plenty of slack to deal with slow coalescing (across many stats) */ + private static final int SLACK = 2000; public void coalesce() { long now = now(); synchronized (_lock) { long measuredPeriod = now - _lastCoalesceDate; - if (measuredPeriod < _period) { - // no need to coalesce + if (measuredPeriod < _period - SLACK) { + // no need to coalesce (assuming we only try to do so once per minute) return; }