Record Class VirtualThreadWorkerPool.Stats

java.lang.Object
java.lang.Record
express.mvp.myra.transport.VirtualThreadWorkerPool.Stats
Record Components:
submitted - number of tasks submitted
completed - number of tasks completed successfully
failed - number of tasks that threw exceptions
rejected - number of tasks rejected after shutdown
threads - number of virtual threads created
Enclosing class:
VirtualThreadWorkerPool

public static record VirtualThreadWorkerPool.Stats(long submitted, long completed, long failed, long rejected, long threads) extends Record
Immutable snapshot of worker pool statistics.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Stats(long submitted, long completed, long failed, long rejected, long threads)
    Creates an instance of a Stats record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the value of the completed record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    long
    Returns the value of the failed record component.
    final int
    Returns a hash code value for this object.
    long
    Returns the value of the rejected record component.
    long
    Returns the value of the submitted record component.
    double
    Returns the success rate as a percentage (0-100).
    long
    Returns the value of the threads record component.
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • Stats

      public Stats(long submitted, long completed, long failed, long rejected, long threads)
      Creates an instance of a Stats record class.
      Parameters:
      submitted - the value for the submitted record component
      completed - the value for the completed record component
      failed - the value for the failed record component
      rejected - the value for the rejected record component
      threads - the value for the threads record component
  • Method Details

    • successRate

      public double successRate()
      Returns the success rate as a percentage (0-100).
      Returns:
      the success rate, or 100 if no tasks have completed
    • toString

      public 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.
    • submitted

      public long submitted()
      Returns the value of the submitted record component.
      Returns:
      the value of the submitted record component
    • completed

      public long completed()
      Returns the value of the completed record component.
      Returns:
      the value of the completed record component
    • failed

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

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

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