Package com.codahale.metrics
Interface MovingAverages
- All Known Implementing Classes:
ExponentialMovingAverages,SlidingTimeWindowMovingAverages
public interface MovingAverages
A triple of moving averages (one-, five-, and fifteen-minute
moving average) as needed by
Meter.
Included implementations are:
ExponentialMovingAveragesexponential decaying average similar to thetopUnix command.SlidingTimeWindowMovingAveragessimple (unweighted) moving average
-
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the fifteen-minute moving average ratedoubleReturns the one-minute moving average ratedoubleReturns the five-minute moving average ratevoidTick 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 Details
-
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
-