Metrics Aspect
Metrics Aspect: Metrics Aspect for statistical analysis. The rule engine instance statistics for the following metrics:
- Current: The number of processes currently being handled by the rule engine
- Total: The total number of processes completed by the rule engine
- Failed: The total number of rule branch chains that failed to execute in the rule engine
- Success: The total number of rule branch chains that successfully executed in the rule engine
To obtain the metrics data of the rule engine, use the following method:
ruleEngine, ok := rulego.Get("rule01")
metrics := ruleEngine.GetMetrics()
if metrics != nil {
fmt.Println(metrics)
}
1
2
3
4
5
2
3
4
5
Reset the metrics data:
ruleEngine, ok := rulego.Get("rule01")
metrics := ruleEngine.GetMetrics()
if metrics != nil {
metrics.Reset()
}
1
2
3
4
5
2
3
4
5
TIP
This aspect will be automatically imported and does not require manual introduction.
Edit this page on GitHub (opens new window)
Last Updated: 2024/10/23, 10:13:01