Record Class RateLimiter.RateLimiterStats
java.lang.Object
java.lang.Record
com.loomcache.server.ratelimit.RateLimiter.RateLimiterStats
- Enclosing class:
RateLimiter
public static record RateLimiter.RateLimiterStats(long totalAllowed, long totalDenied, double currentRate, long availablePermits, long timestamp)
extends Record
Statistics record for rate limiter metrics.
-
Constructor Summary
ConstructorsConstructorDescriptionRateLimiterStats(long totalAllowed, long totalDenied, double currentRate, long availablePermits, long timestamp) Creates an instance of aRateLimiterStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of theavailablePermitsrecord component.doubleReturns the value of thecurrentRaterecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalAllowedrecord component.longReturns the value of thetotalDeniedrecord component.
-
Constructor Details
-
RateLimiterStats
public RateLimiterStats(long totalAllowed, long totalDenied, double currentRate, long availablePermits, long timestamp) Creates an instance of aRateLimiterStatsrecord class.- Parameters:
totalAllowed- the value for thetotalAllowedrecord componenttotalDenied- the value for thetotalDeniedrecord componentcurrentRate- the value for thecurrentRaterecord componentavailablePermits- the value for theavailablePermitsrecord componenttimestamp- the value for thetimestamprecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
totalAllowed
public long totalAllowed()Returns the value of thetotalAllowedrecord component.- Returns:
- the value of the
totalAllowedrecord component
-
totalDenied
public long totalDenied()Returns the value of thetotalDeniedrecord component.- Returns:
- the value of the
totalDeniedrecord component
-
currentRate
public double currentRate()Returns the value of thecurrentRaterecord component.- Returns:
- the value of the
currentRaterecord component
-
availablePermits
public long availablePermits()Returns the value of theavailablePermitsrecord component.- Returns:
- the value of the
availablePermitsrecord component
-
timestamp
public long timestamp()Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-