Record Class SlowLogCollector.Stats
java.lang.Object
java.lang.Record
cloud.opencode.base.observability.SlowLogCollector.Stats
- Record Components:
totalSlowOps- total number of slow operations recorded (cumulative) | 记录的慢操作总数(累积)maxDuration- the longest duration among all buffered slow operations | 缓冲的最长耗时avgDuration- the average duration of all buffered slow operations | 缓冲的平均耗时slowestOperation- the operation type with the longest duration | 耗时最长的操作类型
- Enclosing class:
SlowLogCollector
public static record SlowLogCollector.Stats(long totalSlowOps, Duration maxDuration, Duration avgDuration, String slowestOperation)
extends Record
Aggregated statistics for recorded slow operations.
已记录慢操作的聚合统计信息。
- Since:
- JDK 25, opencode-base-observability V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SlowLogCollector.StatsEmpty stats instance returned when no slow operations have been recorded. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theavgDurationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themaxDurationrecord component.Returns the value of theslowestOperationrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalSlowOpsrecord component.
-
Field Details
-
EMPTY
Empty stats instance returned when no slow operations have been recorded. 未记录慢操作时返回的空统计实例。
-
-
Constructor Details
-
Stats
public Stats(long totalSlowOps, Duration maxDuration, Duration avgDuration, String slowestOperation) Creates an instance of aStatsrecord class.- Parameters:
totalSlowOps- the value for thetotalSlowOpsrecord componentmaxDuration- the value for themaxDurationrecord componentavgDuration- the value for theavgDurationrecord componentslowestOperation- the value for theslowestOperationrecord 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. -
totalSlowOps
public long totalSlowOps()Returns the value of thetotalSlowOpsrecord component.- Returns:
- the value of the
totalSlowOpsrecord component
-
maxDuration
Returns the value of themaxDurationrecord component.- Returns:
- the value of the
maxDurationrecord component
-
avgDuration
Returns the value of theavgDurationrecord component.- Returns:
- the value of the
avgDurationrecord component
-
slowestOperation
Returns the value of theslowestOperationrecord component.- Returns:
- the value of the
slowestOperationrecord component
-