public class UnlockedRateStatistic extends AbstractRateStatistic
Modifier and Type | Field and Description |
---|---|
private long |
count |
private long |
previousSample |
private float |
rateSample |
private long |
rateSampleTime |
private long |
sampleRateMask |
Constructor and Description |
---|
UnlockedRateStatistic(long averagePeriod,
java.util.concurrent.TimeUnit unit)
Create an UnlockedRateStatistic instance with the given average period.
|
Modifier and Type | Method and Description |
---|---|
void |
event()
Fired to record the occurrence of a monitored event.
|
long |
getCount()
Returns the total number of events that have occurred in the lifetime of this statistic.
|
float |
getRate()
Return the rate of events per unit time.
|
getRateAveragePeriod, iterateMovingAverage
private volatile long count
private volatile long rateSampleTime
private volatile float rateSample
private volatile long sampleRateMask
private volatile long previousSample
public UnlockedRateStatistic(long averagePeriod, java.util.concurrent.TimeUnit unit)
averagePeriod
- average periodunit
- period time unitpublic void event()
public long getCount()
public float getRate()