2006-03-20 jrandom

* Fix to allow for some slack when coalescing stats
    * Workaround some oddball errors
This commit is contained in:
jrandom
2006-03-20 05:39:54 +00:00
committed by zzz
parent c5ddfabfe9
commit 343748111a

View File

@ -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;
}