Record Class RateLimiter.RateLimiterSnapshot
java.lang.Object
java.lang.Record
com.loomcache.server.ratelimit.RateLimiter.RateLimiterSnapshot
- Enclosing class:
RateLimiter
public static record RateLimiter.RateLimiterSnapshot(double currentRate, long remainingPermits, long windowStartTime, long totalAllowed, long totalDenied, double utilizationRate)
extends Record
Snapshot of rate limiter state including metrics and rates.
-
Constructor Summary
ConstructorsConstructorDescriptionRateLimiterSnapshot(double currentRate, long remainingPermits, long windowStartTime, long totalAllowed, long totalDenied, double utilizationRate) Creates an instance of aRateLimiterSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns 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 theremainingPermitsrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalAllowedrecord component.longReturns the value of thetotalDeniedrecord component.doubleReturns the value of theutilizationRaterecord component.longReturns the value of thewindowStartTimerecord component.
-
Constructor Details
-
RateLimiterSnapshot
public RateLimiterSnapshot(double currentRate, long remainingPermits, long windowStartTime, long totalAllowed, long totalDenied, double utilizationRate) Creates an instance of aRateLimiterSnapshotrecord class.- Parameters:
currentRate- the value for thecurrentRaterecord componentremainingPermits- the value for theremainingPermitsrecord componentwindowStartTime- the value for thewindowStartTimerecord componenttotalAllowed- the value for thetotalAllowedrecord componenttotalDenied- the value for thetotalDeniedrecord componentutilizationRate- the value for theutilizationRaterecord 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. -
currentRate
public double currentRate()Returns the value of thecurrentRaterecord component.- Returns:
- the value of the
currentRaterecord component
-
remainingPermits
public long remainingPermits()Returns the value of theremainingPermitsrecord component.- Returns:
- the value of the
remainingPermitsrecord component
-
windowStartTime
public long windowStartTime()Returns the value of thewindowStartTimerecord component.- Returns:
- the value of the
windowStartTimerecord component
-
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
-
utilizationRate
public double utilizationRate()Returns the value of theutilizationRaterecord component.- Returns:
- the value of the
utilizationRaterecord component
-