Record Class ExecutionTrace
java.lang.Object
java.lang.Record
cloud.opencode.base.rules.trace.ExecutionTrace
- Record Components:
ruleTraces- trace per rule | 每个规则的轨迹totalDuration- total engine execution time | 引擎执行总时间firedCount- count of fired rules | 已触发规则的数量skippedCount- count of skipped rules | 已跳过规则的数量failedCount- count of failed rules | 已失败规则的数量
public record ExecutionTrace(List<RuleTrace> ruleTraces, Duration totalDuration, int firedCount, int skippedCount, int failedCount)
extends Record
Execution Trace - Records the Complete Execution Trace of a Rule Engine Run
执行轨迹 - 记录规则引擎一次运行的完整执行轨迹
Aggregates individual rule traces with summary counts and total duration.
聚合单个规则轨迹,提供汇总计数和总持续时间。
- Since:
- JDK 25, opencode-base-rules V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionExecutionTrace(List<RuleTrace> ruleTraces, Duration totalDuration, int firedCount, int skippedCount, int failedCount) Canonical constructor with validation 带验证的规范构造函数 -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intReturns the value of thefailedCountrecord component.Returns the list of rule traces that failed 返回已失败的规则轨迹列表intReturns the value of thefiredCountrecord component.Returns the list of rule traces that fired 返回已触发的规则轨迹列表Finds a rule trace by rule name 按规则名称查找规则轨迹final inthashCode()Returns a hash code value for this object.static ExecutionTraceCreates an execution trace from a list of rule traces and total duration, computing fired/skipped/failed counts automatically 从规则轨迹列表和总持续时间创建执行轨迹,自动计算触发/跳过/失败计数Returns the value of theruleTracesrecord component.intReturns the value of theskippedCountrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetotalDurationrecord component.
-
Constructor Details
-
ExecutionTrace
public ExecutionTrace(List<RuleTrace> ruleTraces, Duration totalDuration, int firedCount, int skippedCount, int failedCount) Canonical constructor with validation 带验证的规范构造函数- Parameters:
ruleTraces- trace per rule | 每个规则的轨迹totalDuration- total engine execution time | 引擎执行总时间firedCount- count of fired rules | 已触发规则的数量skippedCount- count of skipped rules | 已跳过规则的数量failedCount- count of failed rules | 已失败规则的数量
-
-
Method Details
-
of
Creates an execution trace from a list of rule traces and total duration, computing fired/skipped/failed counts automatically 从规则轨迹列表和总持续时间创建执行轨迹,自动计算触发/跳过/失败计数- Parameters:
traces- the rule traces | 规则轨迹totalDuration- the total duration | 总持续时间- Returns:
- the execution trace | 执行轨迹
-
firedRules
-
failedRules
-
getTrace
-
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. -
ruleTraces
Returns the value of theruleTracesrecord component.- Returns:
- the value of the
ruleTracesrecord component
-
totalDuration
Returns the value of thetotalDurationrecord component.- Returns:
- the value of the
totalDurationrecord component
-
firedCount
public int firedCount()Returns the value of thefiredCountrecord component.- Returns:
- the value of the
firedCountrecord component
-
skippedCount
public int skippedCount()Returns the value of theskippedCountrecord component.- Returns:
- the value of the
skippedCountrecord component
-
failedCount
public int failedCount()Returns the value of thefailedCountrecord component.- Returns:
- the value of the
failedCountrecord component
-