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/addAlltotalPolled- cumulative number of items removed via poll/take/draintotalPeeks- cumulative number of peek operationscurrentSize- current number of items in the queuepeakSize- 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
ConstructorsConstructorDescriptionQueueStats(long totalAdded, long totalPolled, long totalPeeks, int currentSize, int peakSize) Creates an instance of aQueueStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecurrentSizerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intpeakSize()Returns the value of thepeakSizerecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalAddedrecord component.longReturns the value of thetotalPeeksrecord component.longReturns the value of thetotalPolledrecord component.
-
Constructor Details
-
QueueStats
public QueueStats(long totalAdded, long totalPolled, long totalPeeks, int currentSize, int peakSize) Creates an instance of aQueueStatsrecord class.- Parameters:
totalAdded- the value for thetotalAddedrecord componenttotalPolled- the value for thetotalPolledrecord componenttotalPeeks- the value for thetotalPeeksrecord componentcurrentSize- the value for thecurrentSizerecord componentpeakSize- the value for thepeakSizerecord 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
-
totalPeeks
public long totalPeeks()Returns the value of thetotalPeeksrecord component.- Returns:
- the value of the
totalPeeksrecord component
-
currentSize
public int currentSize()Returns the value of thecurrentSizerecord component.- Returns:
- the value of the
currentSizerecord component
-
peakSize
-