Record Class RetryExecutor.RetryStats

java.lang.Object
java.lang.Record
cloud.opencode.base.cache.resilience.RetryExecutor.RetryStats
Record Components:
totalAttempts - total operation attempts (initial + retries) | 操作总尝试次数(初始 + 重试)
successCount - operations that eventually succeeded | 最终成功的操作数
failureCount - operations that exhausted all retries | 耗尽所有重试的操作数
retryCount - total retry attempts (excludes initial) | 重试尝试总数(不含初始)
totalRetryDelay - cumulative delay waited between retries | 在重试之间等待的累计延迟
Enclosing class:
RetryExecutor

public static record RetryExecutor.RetryStats(long totalAttempts, long successCount, long failureCount, long retryCount, Duration totalRetryDelay) extends Record
Snapshot of cumulative retry statistics. 累积重试统计信息的快照。
Since:
JDK 25, opencode-base-cache V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • RetryStats

      public RetryStats(long totalAttempts, long successCount, long failureCount, long retryCount, Duration totalRetryDelay)
      Creates an instance of a RetryStats record class.
      Parameters:
      totalAttempts - the value for the totalAttempts record component
      successCount - the value for the successCount record component
      failureCount - the value for the failureCount record component
      retryCount - the value for the retryCount record component
      totalRetryDelay - the value for the totalRetryDelay 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.
    • totalAttempts

      public long totalAttempts()
      Returns the value of the totalAttempts record component.
      Returns:
      the value of the totalAttempts record component
    • successCount

      public long successCount()
      Returns the value of the successCount record component.
      Returns:
      the value of the successCount record component
    • failureCount

      public long failureCount()
      Returns the value of the failureCount record component.
      Returns:
      the value of the failureCount record component
    • retryCount

      public long retryCount()
      Returns the value of the retryCount record component.
      Returns:
      the value of the retryCount record component
    • totalRetryDelay

      public Duration totalRetryDelay()
      Returns the value of the totalRetryDelay record component.
      Returns:
      the value of the totalRetryDelay record component