public class RestorableMeter
extends java.lang.Object
Constructor and Description |
---|
RestorableMeter()
Creates a new, uninitialized RestorableMeter.
|
RestorableMeter(double lastM15Rate,
double lastM120Rate)
Restores a RestorableMeter from the last seen 15m and 2h rates.
|
Modifier and Type | Method and Description |
---|---|
long |
count()
The total number of events that have occurred since this object was created.
|
double |
fifteenMinuteRate()
Returns the 15-minute rate in terms of events per second.
|
void |
mark()
Mark the occurrence of an event.
|
void |
mark(long n)
Mark the occurrence of a given number of events.
|
double |
meanRate()
Returns the mean rate of events per second since this object was created.
|
double |
twoHourRate()
Returns the two-hour rate in terms of events per second.
|
public RestorableMeter()
public RestorableMeter(double lastM15Rate, double lastM120Rate)
lastM15Rate
- the last-seen 15m rate, in terms of events per secondlastM120Rate
- the last seen 2h rate, in terms of events per secondpublic void mark()
public void mark(long n)
n
- the number of eventspublic double fifteenMinuteRate()
public double twoHourRate()
public long count()
public double meanRate()
Copyright © 2009-2021 The Apache Software Foundation