Package org.apache.cassandra.metrics
Class RestorableMeter
java.lang.Object
org.apache.cassandra.metrics.RestorableMeter
A meter metric which measures mean throughput as well as fifteen-minute and two-hour
exponentially-weighted moving average throughputs.
This is based heavily on the Meter and EWMA classes from codahale/yammer metrics.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new, uninitialized RestorableMeter.RestorableMeter(double lastM15Rate, double lastM120Rate) Restores a RestorableMeter from the last seen 15m and 2h rates. -
Method Summary
Modifier and TypeMethodDescriptionlongcount()The total number of events that have occurred since this object was created.doubleReturns the 15-minute rate in terms of events per second.voidmark()Mark the occurrence of an event.voidmark(long n) Mark the occurrence of a given number of events.doublemeanRate()Returns the mean rate of events per second since this object was created.doubleReturns the two-hour rate in terms of events per second.
-
Constructor Details
-
RestorableMeter
public RestorableMeter()Creates a new, uninitialized RestorableMeter. -
RestorableMeter
public RestorableMeter(double lastM15Rate, double lastM120Rate) Restores a RestorableMeter from the last seen 15m and 2h rates.- Parameters:
lastM15Rate- the last-seen 15m rate, in terms of events per secondlastM120Rate- the last seen 2h rate, in terms of events per second
-
-
Method Details
-
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
-
fifteenMinuteRate
public double fifteenMinuteRate()Returns the 15-minute rate in terms of events per second. This carries the previous rate when restored. -
twoHourRate
public double twoHourRate()Returns the two-hour rate in terms of events per second. This carries the previous rate when restored. -
count
public long count()The total number of events that have occurred since this object was created. Note that the previous count is *not* carried over when a RestorableMeter is restored. -
meanRate
public double meanRate()Returns the mean rate of events per second since this object was created. Note that the mean rate does *not* carry over when a RestorableMeter is restored, so the mean rate is only a measure since this object was created.
-