Package org.microproxy.extras
Record Class ConcurrencyLimiter.Snapshot
java.lang.Object
java.lang.Record
org.microproxy.extras.ConcurrencyLimiter.Snapshot
- Record Components:
keys- the keys with permits in use or requests waiting, sorted by keyinUse- permits in use, over all keyswaiting- requests waiting, over all keysacquired- permits granted since the limiter was builtrejected- requests over the limit since the limiter was built (refused, or let through in shadow mode)reclaimed- permits reclaimed by the safety net
- Enclosing class:
ConcurrencyLimiter
public static record ConcurrencyLimiter.Snapshot(Map<String,ConcurrencyLimiter.KeyStats> keys, int inUse, int waiting, long acquired, long rejected, long reclaimed)
extends Record
The limiter's state at one moment.
-
Constructor Summary
ConstructorsConstructorDescriptionSnapshot(Map<String, ConcurrencyLimiter.KeyStats> keys, int inUse, int waiting, long acquired, long rejected, long reclaimed) Creates an instance of aSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongacquired()Returns the value of theacquiredrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intinUse()Returns the value of theinUserecord component.keys()Returns the value of thekeysrecord component.longReturns the value of thereclaimedrecord component.longrejected()Returns the value of therejectedrecord component.final StringtoString()Returns a string representation of this record class.intwaiting()Returns the value of thewaitingrecord component.
-
Constructor Details
-
Snapshot
public Snapshot(Map<String, ConcurrencyLimiter.KeyStats> keys, int inUse, int waiting, long acquired, long rejected, long reclaimed) Creates an instance of aSnapshotrecord class.- Parameters:
keys- the value for thekeysrecord componentinUse- the value for theinUserecord componentwaiting- the value for thewaitingrecord componentacquired- the value for theacquiredrecord componentrejected- the value for therejectedrecord componentreclaimed- the value for thereclaimedrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
keys
Returns the value of thekeysrecord component.- Returns:
- the value of the
keysrecord component
-
inUse
public int inUse()Returns the value of theinUserecord component.- Returns:
- the value of the
inUserecord component
-
waiting
public int waiting()Returns the value of thewaitingrecord component.- Returns:
- the value of the
waitingrecord component
-
acquired
public long acquired()Returns the value of theacquiredrecord component.- Returns:
- the value of the
acquiredrecord component
-
rejected
public long rejected()Returns the value of therejectedrecord component.- Returns:
- the value of the
rejectedrecord component
-
reclaimed
public long reclaimed()Returns the value of thereclaimedrecord component.- Returns:
- the value of the
reclaimedrecord component
-