Record Class VirtualThreadWorkerPool.Stats
java.lang.Object
java.lang.Record
express.mvp.myra.transport.VirtualThreadWorkerPool.Stats
- Record Components:
submitted- number of tasks submittedcompleted- number of tasks completed successfullyfailed- number of tasks that threw exceptionsrejected- number of tasks rejected after shutdownthreads- 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
ConstructorsConstructorDescriptionStats(long submitted, long completed, long failed, long rejected, long threads) Creates an instance of aStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thecompletedrecord component.final booleanIndicates whether some other object is "equal to" this one.longfailed()Returns the value of thefailedrecord component.final inthashCode()Returns a hash code value for this object.longrejected()Returns the value of therejectedrecord component.longReturns the value of thesubmittedrecord component.doubleReturns the success rate as a percentage (0-100).longthreads()Returns the value of thethreadsrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
Stats
public Stats(long submitted, long completed, long failed, long rejected, long threads) Creates an instance of aStatsrecord class.
-
-
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
-
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. -
submitted
-
completed
-
failed
-
rejected
-
threads
-