Record Class ExecutorStats
java.lang.Object
java.lang.Record
com.loomcache.server.executor.ExecutorStats
- Record Components:
executorName- the name of the executor servicetotalSubmitted- total number of tasks submitted since creationtotalCompleted- total number of tasks that completed successfullytotalFailed- total number of tasks that failed with an exceptiontotalCancelled- total number of tasks that were cancelledactiveTasks- number of tasks currently in PENDING or RUNNING stateavgExecutionTimeMs- average execution time in milliseconds for completed tasks
public record ExecutorStats(String executorName, long totalSubmitted, long totalCompleted, long totalFailed, long totalCancelled, int activeTasks, double avgExecutionTimeMs)
extends Record
Immutable statistics snapshot for a named
DistributedExecutorService.
Provides aggregate metrics: total submitted/completed/failed/cancelled counts, current active task count, and average execution time across all completed tasks.
- Since:
- 2.0
-
Constructor Summary
ConstructorsConstructorDescriptionExecutorStats(String executorName, long totalSubmitted, long totalCompleted, long totalFailed, long totalCancelled, int activeTasks, double avgExecutionTimeMs) Creates an instance of aExecutorStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theactiveTasksrecord component.doubleReturns the value of theavgExecutionTimeMsrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexecutorNamerecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalCancelledrecord component.longReturns the value of thetotalCompletedrecord component.longReturns the value of thetotalFailedrecord component.longReturns the value of thetotalSubmittedrecord component.
-
Constructor Details
-
ExecutorStats
public ExecutorStats(String executorName, long totalSubmitted, long totalCompleted, long totalFailed, long totalCancelled, int activeTasks, double avgExecutionTimeMs) Creates an instance of aExecutorStatsrecord class.- Parameters:
executorName- the value for theexecutorNamerecord componenttotalSubmitted- the value for thetotalSubmittedrecord componenttotalCompleted- the value for thetotalCompletedrecord componenttotalFailed- the value for thetotalFailedrecord componenttotalCancelled- the value for thetotalCancelledrecord componentactiveTasks- the value for theactiveTasksrecord componentavgExecutionTimeMs- the value for theavgExecutionTimeMsrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
executorName
Returns the value of theexecutorNamerecord component.- Returns:
- the value of the
executorNamerecord component
-
totalSubmitted
public long totalSubmitted()Returns the value of thetotalSubmittedrecord component.- Returns:
- the value of the
totalSubmittedrecord component
-
totalCompleted
public long totalCompleted()Returns the value of thetotalCompletedrecord component.- Returns:
- the value of the
totalCompletedrecord component
-
totalFailed
public long totalFailed()Returns the value of thetotalFailedrecord component.- Returns:
- the value of the
totalFailedrecord component
-
totalCancelled
public long totalCancelled()Returns the value of thetotalCancelledrecord component.- Returns:
- the value of the
totalCancelledrecord component
-
activeTasks
public int activeTasks()Returns the value of theactiveTasksrecord component.- Returns:
- the value of the
activeTasksrecord component
-
avgExecutionTimeMs
public double avgExecutionTimeMs()Returns the value of theavgExecutionTimeMsrecord component.- Returns:
- the value of the
avgExecutionTimeMsrecord component
-