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 Summary
ConstructorsConstructorDescriptionRetryStats(long totalAttempts, long successCount, long failureCount, long retryCount, Duration totalRetryDelay) Creates an instance of aRetryStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.longReturns the value of thefailureCountrecord component.final inthashCode()Returns a hash code value for this object.longReturns the value of theretryCountrecord component.longReturns the value of thesuccessCountrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalAttemptsrecord component.Returns the value of thetotalRetryDelayrecord component.
-
Constructor Details
-
RetryStats
public RetryStats(long totalAttempts, long successCount, long failureCount, long retryCount, Duration totalRetryDelay) Creates an instance of aRetryStatsrecord class.- Parameters:
totalAttempts- the value for thetotalAttemptsrecord componentsuccessCount- the value for thesuccessCountrecord componentfailureCount- the value for thefailureCountrecord componentretryCount- the value for theretryCountrecord componenttotalRetryDelay- the value for thetotalRetryDelayrecord 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. -
totalAttempts
public long totalAttempts()Returns the value of thetotalAttemptsrecord component.- Returns:
- the value of the
totalAttemptsrecord component
-
successCount
public long successCount()Returns the value of thesuccessCountrecord component.- Returns:
- the value of the
successCountrecord component
-
failureCount
public long failureCount()Returns the value of thefailureCountrecord component.- Returns:
- the value of the
failureCountrecord component
-
retryCount
public long retryCount()Returns the value of theretryCountrecord component.- Returns:
- the value of the
retryCountrecord component
-
totalRetryDelay
Returns the value of thetotalRetryDelayrecord component.- Returns:
- the value of the
totalRetryDelayrecord component
-