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 byMeter
.Included implementations are:
ExponentialMovingAverages
exponential decaying average similar to thetop
Unix command.SlidingTimeWindowMovingAverages
simple (unweighted) moving average
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description double
getM15Rate()
Returns the fifteen-minute moving average ratedouble
getM1Rate()
Returns the one-minute moving average ratedouble
getM5Rate()
Returns the five-minute moving average ratevoid
tickIfNecessary()
Tick the internal clock of the MovingAverages implementation if needed (according to the internal ticking interval)void
update(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
-
-