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 queuetotalPolled- total number of items ever polled/removed from the queuecurrentSize- current number of items in the queuedistinctPriorities- number of distinct priority valuesavgPriority- 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 Summary
ConstructorsConstructorDescriptionPriorityQueueStats(long totalAdded, long totalPolled, long currentSize, int distinctPriorities, double avgPriority) Creates an instance of aPriorityQueueStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theavgPriorityrecord component.longReturns the value of thecurrentSizerecord component.intReturns the value of thedistinctPrioritiesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalAddedrecord component.longReturns the value of thetotalPolledrecord component.
-
Constructor Details
-
PriorityQueueStats
public PriorityQueueStats(long totalAdded, long totalPolled, long currentSize, int distinctPriorities, double avgPriority) Creates an instance of aPriorityQueueStatsrecord class.- Parameters:
totalAdded- the value for thetotalAddedrecord componenttotalPolled- the value for thetotalPolledrecord componentcurrentSize- the value for thecurrentSizerecord componentdistinctPriorities- the value for thedistinctPrioritiesrecord componentavgPriority- the value for theavgPriorityrecord 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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
totalAdded
public long totalAdded()Returns the value of thetotalAddedrecord component.- Returns:
- the value of the
totalAddedrecord component
-
totalPolled
public long totalPolled()Returns the value of thetotalPolledrecord component.- Returns:
- the value of the
totalPolledrecord component
-
currentSize
public long currentSize()Returns the value of thecurrentSizerecord component.- Returns:
- the value of the
currentSizerecord component
-
distinctPriorities
public int distinctPriorities()Returns the value of thedistinctPrioritiesrecord component.- Returns:
- the value of the
distinctPrioritiesrecord component
-
avgPriority
public double avgPriority()Returns the value of theavgPriorityrecord component.- Returns:
- the value of the
avgPriorityrecord component
-