Record Class DistributedQueue.QueueStats

java.lang.Object
java.lang.Record
com.loomcache.server.datastructures.DistributedQueue.QueueStats
Record Components:
totalAdded - cumulative number of items added via offer/put/addAll
totalPolled - cumulative number of items removed via poll/take/drain
totalPeeks - cumulative number of peek operations
currentSize - current number of items in the queue
peakSize - highest size reached by the queue
Enclosing class:
DistributedQueue<E>

public static record DistributedQueue.QueueStats(long totalAdded, long totalPolled, long totalPeeks, int currentSize, int peakSize) extends Record
Queue statistics record — tracks cumulative and current queue metrics.
Since:
1.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    QueueStats(long totalAdded, long totalPolled, long totalPeeks, int currentSize, int peakSize)
    Creates an instance of a QueueStats record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the currentSize record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the peakSize record component.
    final String
    Returns a string representation of this record class.
    long
    Returns the value of the totalAdded record component.
    long
    Returns the value of the totalPeeks record component.
    long
    Returns the value of the totalPolled record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • QueueStats

      public QueueStats(long totalAdded, long totalPolled, long totalPeeks, int currentSize, int peakSize)
      Creates an instance of a QueueStats record class.
      Parameters:
      totalAdded - the value for the totalAdded record component
      totalPolled - the value for the totalPolled record component
      totalPeeks - the value for the totalPeeks record component
      currentSize - the value for the currentSize record component
      peakSize - the value for the peakSize 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. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      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.
    • totalAdded

      public long totalAdded()
      Returns the value of the totalAdded record component.
      Returns:
      the value of the totalAdded record component
    • totalPolled

      public long totalPolled()
      Returns the value of the totalPolled record component.
      Returns:
      the value of the totalPolled record component
    • totalPeeks

      public long totalPeeks()
      Returns the value of the totalPeeks record component.
      Returns:
      the value of the totalPeeks record component
    • currentSize

      public int currentSize()
      Returns the value of the currentSize record component.
      Returns:
      the value of the currentSize record component
    • peakSize

      public int peakSize()
      Returns the value of the peakSize record component.
      Returns:
      the value of the peakSize record component