Class EWMA
- java.lang.Object
-
- com.emc.mongoose.base.metrics.type.EWMA
-
- All Implemented Interfaces:
LoadAverage
public final class EWMA extends java.lang.Object implements LoadAverage
Copied from dropwizard metrics library 4.0.3
-
-
Constructor Summary
Constructors Constructor Description EWMA(double alpha, long interval, java.util.concurrent.TimeUnit intervalUnit)Create a new EWMA with a specific smoothing constant.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublerate(java.util.concurrent.TimeUnit rateUnit)Returns the rate in the given units of time.voidtick()Mark the passage of time and decay the current rate accordingly.voidupdate(long n)Update the moving average with a new value.
-
-
-
Method Detail
-
update
public final void update(long n)
Description copied from interface:LoadAverageUpdate the moving average with a new value.- Specified by:
updatein interfaceLoadAverage- Parameters:
n- the new value
-
tick
public final void tick()
Description copied from interface:LoadAverageMark the passage of time and decay the current rate accordingly.- Specified by:
tickin interfaceLoadAverage
-
rate
public final double rate(java.util.concurrent.TimeUnit rateUnit)
Description copied from interface:LoadAverageReturns the rate in the given units of time.- Specified by:
ratein interfaceLoadAverage- Parameters:
rateUnit- the unit of time- Returns:
- the rate
-
-