Package org.xbib.metrics.common
Class Meter
- java.lang.Object
-
- org.xbib.metrics.common.Meter
-
- All Implemented Interfaces:
org.xbib.metrics.api.Metered,org.xbib.metrics.api.Metric
public class Meter extends java.lang.Object implements org.xbib.metrics.api.MeteredA meter metric which measures mean throughput and one-, five-, and fifteen-minute exponentially-weighted moving average throughputs.- See Also:
ExpWeightedMovingAverage
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longelapsed()longgetCount()doublegetFifteenMinuteRate()doublegetFiveMinuteRate()doublegetMeanRate()doublegetOneMinuteRate()voidmark()Mark the occurrence of an event.voidmark(long n)Mark the occurrence of a given number of events.voidshutdown()voidstart(long intervalSeconds)voidstop()
-
-
-
Constructor Detail
-
Meter
public Meter(java.util.concurrent.ScheduledExecutorService executorService)
Creates a newMeter.- Parameters:
executorService- the executor service
-
Meter
public Meter(java.util.concurrent.ScheduledExecutorService executorService, org.xbib.metrics.api.Clock clock)Creates a newMeter.- Parameters:
executorService- the executor serviceclock- the clock to use for the meter ticks
-
-
Method Detail
-
start
public void start(long intervalSeconds)
-
stop
public void stop()
-
shutdown
public void shutdown()
-
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
-
getCount
public long getCount()
- Specified by:
getCountin interfaceorg.xbib.metrics.api.Metered
-
getFifteenMinuteRate
public double getFifteenMinuteRate()
- Specified by:
getFifteenMinuteRatein interfaceorg.xbib.metrics.api.Metered
-
getFiveMinuteRate
public double getFiveMinuteRate()
- Specified by:
getFiveMinuteRatein interfaceorg.xbib.metrics.api.Metered
-
getMeanRate
public double getMeanRate()
- Specified by:
getMeanRatein interfaceorg.xbib.metrics.api.Metered
-
getOneMinuteRate
public double getOneMinuteRate()
- Specified by:
getOneMinuteRatein interfaceorg.xbib.metrics.api.Metered
-
elapsed
public long elapsed()
-
-