Package io.dropwizard.metrics5
Class ExponentialMovingAverages
java.lang.Object
io.dropwizard.metrics5.ExponentialMovingAverages
- All Implemented Interfaces:
MovingAverages
A triple (one, five and fifteen minutes) of exponentially-weighted moving average rates as needed by
Meter
.
The rates have the same exponential decay factor as the fifteen-minute load average in the
top
Unix command.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newExponentialMovingAverages
.ExponentialMovingAverages
(Clock clock) Creates a newExponentialMovingAverages
. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the fifteen-minute moving average ratedouble
Returns the one-minute moving average ratedouble
Returns the five-minute moving average ratelong
getSum()
void
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.
-
Constructor Details
-
ExponentialMovingAverages
public ExponentialMovingAverages()Creates a newExponentialMovingAverages
. -
ExponentialMovingAverages
Creates a newExponentialMovingAverages
.
-
-
Method Details
-
update
public void update(long n) Description copied from interface:MovingAverages
Update all three moving averages with n events having occurred since the last update.- Specified by:
update
in interfaceMovingAverages
-
tickIfNecessary
public void tickIfNecessary()Description copied from interface:MovingAverages
Tick the internal clock of the MovingAverages implementation if needed (according to the internal ticking interval)- Specified by:
tickIfNecessary
in interfaceMovingAverages
-
getM1Rate
public double getM1Rate()Description copied from interface:MovingAverages
Returns the one-minute moving average rate- Specified by:
getM1Rate
in interfaceMovingAverages
- Returns:
- the one-minute moving average rate
-
getM5Rate
public double getM5Rate()Description copied from interface:MovingAverages
Returns the five-minute moving average rate- Specified by:
getM5Rate
in interfaceMovingAverages
- Returns:
- the five-minute moving average rate
-
getM15Rate
public double getM15Rate()Description copied from interface:MovingAverages
Returns the fifteen-minute moving average rate- Specified by:
getM15Rate
in interfaceMovingAverages
- Returns:
- the fifteen-minute moving average rate
-
getSum
public long getSum()- Specified by:
getSum
in interfaceMovingAverages
-