Package com.codahale.metrics
Interface MovingAverages
-
- All Known Implementing Classes:
ExponentialMovingAverages,SlidingTimeWindowMovingAverages
public interface MovingAveragesA triple of moving averages (one-, five-, and fifteen-minute moving average) as needed byMeter.Included implementations are:
ExponentialMovingAveragesexponential decaying average similar to thetopUnix command.SlidingTimeWindowMovingAveragessimple (unweighted) moving average
-
-
Method Summary
All Methods Instance Methods Abstract 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 ratevoidtickIfNecessary()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.
-
-
-
Method Detail
-
tickIfNecessary
void tickIfNecessary()
Tick the internal clock of the MovingAverages implementation if needed (according to the internal ticking interval)
-
update
void update(long n)
Update all three moving averages with n events having occurred since the last update.- Parameters:
n-
-
getM1Rate
double getM1Rate()
Returns the one-minute moving average rate- Returns:
- the one-minute moving average rate
-
getM5Rate
double getM5Rate()
Returns the five-minute moving average rate- Returns:
- the five-minute moving average rate
-
getM15Rate
double getM15Rate()
Returns the fifteen-minute moving average rate- Returns:
- the fifteen-minute moving average rate
-
-