Record Class RateLimiter.RateLimiterStats
java.lang.Object
java.lang.Record
com.loomcache.server.network.RateLimiter.RateLimiterStats
- Enclosing class:
RateLimiter
public static record RateLimiter.RateLimiterStats(long totalRequests, long totalAllowed, long totalDenied, int activeClients, Map<String, RateLimiter.ClientStats> perClientStats)
extends Record
Immutable snapshot of rate limiter metrics.
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionRateLimiterStats(long totalRequests, long totalAllowed, long totalDenied, int activeClients, Map<String, RateLimiter.ClientStats> perClientStats) Creates an instance of aRateLimiterStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theactiveClientsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theperClientStatsrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalAllowedrecord component.longReturns the value of thetotalDeniedrecord component.longReturns the value of thetotalRequestsrecord component.
-
Constructor Details
-
RateLimiterStats
public RateLimiterStats(long totalRequests, long totalAllowed, long totalDenied, int activeClients, Map<String, RateLimiter.ClientStats> perClientStats) Creates an instance of aRateLimiterStatsrecord class.- Parameters:
totalRequests- the value for thetotalRequestsrecord componenttotalAllowed- the value for thetotalAllowedrecord componenttotalDenied- the value for thetotalDeniedrecord componentactiveClients- the value for theactiveClientsrecord componentperClientStats- the value for theperClientStatsrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
totalRequests
public long totalRequests()Returns the value of thetotalRequestsrecord component.- Returns:
- the value of the
totalRequestsrecord 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
-
activeClients
public int activeClients()Returns the value of theactiveClientsrecord component.- Returns:
- the value of the
activeClientsrecord component
-
perClientStats
Returns the value of theperClientStatsrecord component.- Returns:
- the value of the
perClientStatsrecord component
-