Package com.codahale.metrics
Class Meter
- java.lang.Object
-
- com.codahale.metrics.Meter
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetCount()Returns the number of events which have been marked.doublegetFifteenMinuteRate()Returns the fifteen-minute exponentially-weighted moving average rate at which events have occurred since the meter was created.doublegetFiveMinuteRate()Returns the five-minute exponentially-weighted moving average rate at which events have occurred since the meter was created.doublegetMeanRate()Returns the mean rate at which events have occurred since the meter was created.doublegetOneMinuteRate()Returns the one-minute exponentially-weighted moving average rate at which events have occurred since the meter was created.voidmark()Mark the occurrence of an event.voidmark(long n)Mark the occurrence of a given number of events.private voidtickIfNecessary()
-
-
-
Field Detail
-
TICK_INTERVAL
private static final long TICK_INTERVAL
-
m1Rate
private final EWMA m1Rate
-
m5Rate
private final EWMA m5Rate
-
m15Rate
private final EWMA m15Rate
-
count
private final LongAdder count
-
startTime
private final long startTime
-
lastTick
private final java.util.concurrent.atomic.AtomicLong lastTick
-
clock
private final Clock clock
-
-
Method Detail
-
mark
public void mark()
Mark the occurrence of an event.
-
mark
public void mark(long n)
Mark the occurrence of a given number of events.- Parameters:
n- the number of events
-
tickIfNecessary
private void tickIfNecessary()
-
getCount
public long getCount()
Description copied from interface:MeteredReturns the number of events which have been marked.
-
getFifteenMinuteRate
public double getFifteenMinuteRate()
Description copied from interface:MeteredReturns the fifteen-minute exponentially-weighted moving average rate at which events have occurred since the meter was created. This rate has the same exponential decay factor as the fifteen-minute load average in thetopUnix command.- Specified by:
getFifteenMinuteRatein interfaceMetered- Returns:
- the fifteen-minute exponentially-weighted moving average rate at which events have occurred since the meter was created
-
getFiveMinuteRate
public double getFiveMinuteRate()
Description copied from interface:MeteredReturns the five-minute exponentially-weighted moving average rate at which events have occurred since the meter was created. This rate has the same exponential decay factor as the five-minute load average in thetopUnix command.- Specified by:
getFiveMinuteRatein interfaceMetered- Returns:
- the five-minute exponentially-weighted moving average rate at which events have occurred since the meter was created
-
getMeanRate
public double getMeanRate()
Description copied from interface:MeteredReturns the mean rate at which events have occurred since the meter was created.- Specified by:
getMeanRatein interfaceMetered- Returns:
- the mean rate at which events have occurred since the meter was created
-
getOneMinuteRate
public double getOneMinuteRate()
Description copied from interface:MeteredReturns the one-minute exponentially-weighted moving average rate at which events have occurred since the meter was created. This rate has the same exponential decay factor as the one-minute load average in thetopUnix command.- Specified by:
getOneMinuteRatein interfaceMetered- Returns:
- the one-minute exponentially-weighted moving average rate at which events have occurred since the meter was created
-
-