Package io.dropwizard.metrics5
Class ExponentialMovingAverages
- java.lang.Object
-
- io.dropwizard.metrics5.ExponentialMovingAverages
-
- All Implemented Interfaces:
MovingAverages
public class ExponentialMovingAverages extends Object implements MovingAverages
A triple (one, five and fifteen minutes) of exponentially-weighted moving average rates as needed byMeter.The rates have the same exponential decay factor as the fifteen-minute load average in the
topUnix command.
-
-
Constructor Summary
Constructors Constructor Description ExponentialMovingAverages()Creates a newExponentialMovingAverages.ExponentialMovingAverages(Clock clock)Creates a newExponentialMovingAverages.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetM15Rate()Returns the fifteen-minute moving average ratedoublegetM1Rate()Returns the one-minute moving average ratedoublegetM5Rate()Returns the five-minute moving average ratelonggetSum()voidtickIfNecessary()Tick the internal clock of the MovingAverages implementation if needed (according to the internal ticking interval)voidupdate(long n)Update all three moving averages with n events having occurred since the last update.
-
-
-
Constructor Detail
-
ExponentialMovingAverages
public ExponentialMovingAverages()
Creates a newExponentialMovingAverages.
-
ExponentialMovingAverages
public ExponentialMovingAverages(Clock clock)
Creates a newExponentialMovingAverages.
-
-
Method Detail
-
update
public void update(long n)
Description copied from interface:MovingAveragesUpdate all three moving averages with n events having occurred since the last update.- Specified by:
updatein interfaceMovingAverages
-
tickIfNecessary
public void tickIfNecessary()
Description copied from interface:MovingAveragesTick the internal clock of the MovingAverages implementation if needed (according to the internal ticking interval)- Specified by:
tickIfNecessaryin interfaceMovingAverages
-
getM1Rate
public double getM1Rate()
Description copied from interface:MovingAveragesReturns the one-minute moving average rate- Specified by:
getM1Ratein interfaceMovingAverages- Returns:
- the one-minute moving average rate
-
getM5Rate
public double getM5Rate()
Description copied from interface:MovingAveragesReturns the five-minute moving average rate- Specified by:
getM5Ratein interfaceMovingAverages- Returns:
- the five-minute moving average rate
-
getM15Rate
public double getM15Rate()
Description copied from interface:MovingAveragesReturns the fifteen-minute moving average rate- Specified by:
getM15Ratein interfaceMovingAverages- Returns:
- the fifteen-minute moving average rate
-
getSum
public long getSum()
- Specified by:
getSumin interfaceMovingAverages
-
-