|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.solr.util.stats.EWMA
public class EWMA
An exponentially-weighted moving average.
Constructor Summary | |
---|---|
EWMA(double alpha,
long interval,
TimeUnit intervalUnit)
Create a new EWMA with a specific smoothing constant. |
Method Summary | |
---|---|
static EWMA |
fifteenMinuteEWMA()
Creates a new EWMA which is equivalent to the UNIX fifteen minute load average and which expects to be ticked every 5 seconds. |
static EWMA |
fiveMinuteEWMA()
Creates a new EWMA which is equivalent to the UNIX five minute load average and which expects to be ticked every 5 seconds. |
double |
getRate(TimeUnit rateUnit)
Returns the rate in the given units of time. |
static EWMA |
oneMinuteEWMA()
Creates a new EWMA which is equivalent to the UNIX one minute load average and which expects to be ticked every 5 seconds. |
void |
tick()
Mark the passage of time and decay the current rate accordingly. |
void |
update(long n)
Update the moving average with a new value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EWMA(double alpha, long interval, TimeUnit intervalUnit)
alpha
- the smoothing constantinterval
- the expected tick intervalintervalUnit
- the time unit of the tick intervalMethod Detail |
---|
public static EWMA oneMinuteEWMA()
public static EWMA fiveMinuteEWMA()
public static EWMA fifteenMinuteEWMA()
public void update(long n)
n
- the new valuepublic void tick()
public double getRate(TimeUnit rateUnit)
rateUnit
- the unit of time
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |