public class SlidingTimeRate
extends java.lang.Object
| Constructor and Description | 
|---|
| SlidingTimeRate(TimeSource timeSource,
               long size,
               long precision,
               java.util.concurrent.TimeUnit unit)Creates a sliding rate whose time window is of the given size, with the given precision and time unit. | 
| Modifier and Type | Method and Description | 
|---|---|
| double | get(long toAgo,
   java.util.concurrent.TimeUnit unit)Gets the current rate in the given time unit from the beginning of the time window to the
 provided point in time ago. | 
| double | get(java.util.concurrent.TimeUnit unit)Gets the current rate in the given time unit. | 
| void | prune()Prunes the time window of old unused updates. | 
| int | size() | 
| void | update(int delta)Updates the rate. | 
public SlidingTimeRate(TimeSource timeSource, long size, long precision, java.util.concurrent.TimeUnit unit)
public void update(int delta)
public double get(long toAgo,
                  java.util.concurrent.TimeUnit unit)
public double get(java.util.concurrent.TimeUnit unit)
public void prune()
public int size()
Copyright © 2018 The Apache Software Foundation