Package org.eclipse.jetty.util.statistic
Class RateStatistic
java.lang.Object
org.eclipse.jetty.util.statistic.RateStatistic
Statistics on a time sequence rate.
Calculates the rate at which the record()
method is called
over the configured period, retaining also the total count and maximum
rate achieved.
The implementation keeps a Deque of timestamps for all records for the last time period, so this method is not suitable for large rates unless a small time period is used.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
dump()
long
getCount()
Get the number of samples recorded.long
getMax()
Get the max number of samples per period..long
long
int
getRate()
Get the number of records in the current period.getUnits()
int
record()
Records a sample value.void
reset()
Resets the statistics.toString()
-
Constructor Details
-
RateStatistic
-
-
Method Details
-
getPeriod
public long getPeriod() -
getUnits
-
reset
public void reset()Resets the statistics. -
age
-
record
public int record()Records a sample value.- Returns:
- the number of records in the current period.
-
getRate
public int getRate()Get the number of records in the current period.- Returns:
- the number of records in the current period
-
getMax
public long getMax()Get the max number of samples per period..- Returns:
- the max number of samples per period.
-
getOldest
- Parameters:
units
- the units of the return- Returns:
- the age of the oldest sample in the requested units
-
getCount
public long getCount()Get the number of samples recorded.- Returns:
- the number of samples recorded
-
dump
-
dump
-
toString
-