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 key
inUse - permits in use, over all keys
waiting - requests waiting, over all keys
acquired - permits granted since the limiter was built
rejected - 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 Details

    • Snapshot

      public Snapshot(Map<String,ConcurrencyLimiter.KeyStats> keys, int inUse, int waiting, long acquired, long rejected, long reclaimed)
      Creates an instance of a Snapshot record class.
      Parameters:
      keys - the value for the keys record component
      inUse - the value for the inUse record component
      waiting - the value for the waiting record component
      acquired - the value for the acquired record component
      rejected - the value for the rejected record component
      reclaimed - the value for the reclaimed record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • keys

      Returns the value of the keys record component.
      Returns:
      the value of the keys record component
    • inUse

      public int inUse()
      Returns the value of the inUse record component.
      Returns:
      the value of the inUse record component
    • waiting

      public int waiting()
      Returns the value of the waiting record component.
      Returns:
      the value of the waiting record component
    • acquired

      public long acquired()
      Returns the value of the acquired record component.
      Returns:
      the value of the acquired record component
    • rejected

      public long rejected()
      Returns the value of the rejected record component.
      Returns:
      the value of the rejected record component
    • reclaimed

      public long reclaimed()
      Returns the value of the reclaimed record component.
      Returns:
      the value of the reclaimed record component