Class IntervalledCounter
java.lang.Object
com.zenith.feature.ratelimiter.IntervalledCounter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTime(long currTime) voidaddTime(long currTime, long count) doublegetRate()intvoidupdateAndAdd(long count) voidupdateAndAdd(long count, long currTime) voidvoidupdateCurrentTime(long currentTime)
-
Constructor Details
-
IntervalledCounter
public IntervalledCounter(long interval)
-
-
Method Details
-
updateCurrentTime
public void updateCurrentTime() -
updateCurrentTime
public void updateCurrentTime(long currentTime) -
addTime
public void addTime(long currTime) -
addTime
public void addTime(long currTime, long count) -
updateAndAdd
public void updateAndAdd(long count) -
updateAndAdd
public void updateAndAdd(long count, long currTime) -
getRate
public double getRate() -
totalDataPoints
public int totalDataPoints()
-