/** * When an event occurs at the specified time, this method reflects that in * the rolling window. * <p/> * * @param time the time at which the event occurred * @param delta the delta that will be added to the window */ public void incAt(long time, long delta) { int bi = computeBucketIndex(time); Bucket bucket = buckets[bi]; // If the last time the bucket was updated is out of the scope of the // rolling window, reset the bucket. if (bucket.isStaleNow(time)) { bucket.safeReset(time); } bucket.inc(delta); }
/** * When an event occurs at the specified time, this method reflects that in * the rolling window. * <p/> * * @param time the time at which the event occurred * @param delta the delta that will be added to the window */ public void incAt(long time, long delta) { int bi = computeBucketIndex(time); Bucket bucket = buckets[bi]; // If the last time the bucket was updated is out of the scope of the // rolling window, reset the bucket. if (bucket.isStaleNow(time)) { bucket.safeReset(time); } bucket.inc(delta); }
/** * When an event occurs at the specified time, this method reflects that in * the rolling window. * <p/> * * @param time the time at which the event occurred * @param delta the delta that will be added to the window */ public void incAt(long time, long delta) { int bi = computeBucketIndex(time); Bucket bucket = buckets[bi]; // If the last time the bucket was updated is out of the scope of the // rolling window, reset the bucket. if (bucket.isStaleNow(time)) { bucket.safeReset(time); } bucket.inc(delta); }