public class RateTracker extends Object
Constructor and Description |
---|
RateTracker(int validTimeWindowInMils,
int numBuckets) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
static void |
main(String[] args) |
void |
notify(long count)
Notify the tracker upon new arrivals
|
double |
reportRate() |
public RateTracker(int validTimeWindowInMils, int numBuckets)
validTimeWindowInMils
- events that happened before validTimeWindowInMils are not considered
when reporting the rate.numBuckets
- the number of time sildes to divide validTimeWindows. The more buckets,
the smother the reported results will be.Copyright © 2016 The Apache Software Foundation. All Rights Reserved.