Class HitCounter
- java.lang.Object
-
- org.apache.pinot.broker.queryquota.HitCounter
-
- Direct Known Subclasses:
MaxHitRateTracker
public class HitCounter extends Object
This hit counter is for counting the number of hits within a range of time. Right now the granularity we use is second. In order to save the space and time, we store the number of hits over the last 100 time buckets. When the method hit gets called, we put the timestamp to the specified bucket. When the method getHitCount gets called, we sum all the number of hits within the last 100 time buckets.
-
-
Constructor Summary
Constructors Constructor Description HitCounter(int timeRangeInSeconds)HitCounter(int timeRangeInSeconds, int bucketCount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetHitCount()Get the total hit count within a time range.voidhit()Increase the hit count in the current bucket.
-