Record Class DistributedPriorityQueue.PriorityQueueStats

java.lang.Object
java.lang.Record
com.loomcache.server.datastructures.DistributedPriorityQueue.PriorityQueueStats
Record Components:
totalAdded - total number of items ever added to the queue
totalPolled - total number of items ever polled/removed from the queue
currentSize - current number of items in the queue
distinctPriorities - number of distinct priority values
avgPriority - average priority value of items in queue
Enclosing class:
DistributedPriorityQueue<V>

public static record DistributedPriorityQueue.PriorityQueueStats(long totalAdded, long totalPolled, long currentSize, int distinctPriorities, double avgPriority) extends Record
Statistics snapshot of the priority queue.
Since:
1.0
  • Constructor Details

    • PriorityQueueStats

      public PriorityQueueStats(long totalAdded, long totalPolled, long currentSize, int distinctPriorities, double avgPriority)
      Creates an instance of a PriorityQueueStats record class.
      Parameters:
      totalAdded - the value for the totalAdded record component
      totalPolled - the value for the totalPolled record component
      currentSize - the value for the currentSize record component
      distinctPriorities - the value for the distinctPriorities record component
      avgPriority - the value for the avgPriority 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
    • currentSize

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

      public int distinctPriorities()
      Returns the value of the distinctPriorities record component.
      Returns:
      the value of the distinctPriorities record component
    • avgPriority

      public double avgPriority()
      Returns the value of the avgPriority record component.
      Returns:
      the value of the avgPriority record component