Record Class ExecutorStats

java.lang.Object
java.lang.Record
com.loomcache.server.executor.ExecutorStats
Record Components:
executorName - the name of the executor service
totalSubmitted - total number of tasks submitted since creation
totalCompleted - total number of tasks that completed successfully
totalFailed - total number of tasks that failed with an exception
totalCancelled - total number of tasks that were cancelled
activeTasks - number of tasks currently in PENDING or RUNNING state
avgExecutionTimeMs - 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 Details

    • ExecutorStats

      public ExecutorStats(String executorName, long totalSubmitted, long totalCompleted, long totalFailed, long totalCancelled, int activeTasks, double avgExecutionTimeMs)
      Creates an instance of a ExecutorStats record class.
      Parameters:
      executorName - the value for the executorName record component
      totalSubmitted - the value for the totalSubmitted record component
      totalCompleted - the value for the totalCompleted record component
      totalFailed - the value for the totalFailed record component
      totalCancelled - the value for the totalCancelled record component
      activeTasks - the value for the activeTasks record component
      avgExecutionTimeMs - the value for the avgExecutionTimeMs record component
  • Method Details

    • toString

      public final 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • executorName

      public String executorName()
      Returns the value of the executorName record component.
      Returns:
      the value of the executorName record component
    • totalSubmitted

      public long totalSubmitted()
      Returns the value of the totalSubmitted record component.
      Returns:
      the value of the totalSubmitted record component
    • totalCompleted

      public long totalCompleted()
      Returns the value of the totalCompleted record component.
      Returns:
      the value of the totalCompleted record component
    • totalFailed

      public long totalFailed()
      Returns the value of the totalFailed record component.
      Returns:
      the value of the totalFailed record component
    • totalCancelled

      public long totalCancelled()
      Returns the value of the totalCancelled record component.
      Returns:
      the value of the totalCancelled record component
    • activeTasks

      public int activeTasks()
      Returns the value of the activeTasks record component.
      Returns:
      the value of the activeTasks record component
    • avgExecutionTimeMs

      public double avgExecutionTimeMs()
      Returns the value of the avgExecutionTimeMs record component.
      Returns:
      the value of the avgExecutionTimeMs record component