yyqdbngt opened a new pull request, #3578:
URL: https://github.com/apache/rocketmq-dashboard/pull/3578
### Summary
Adds the first dedicated unit test suite for `AlertRuleEvaluator`, the pure
evaluation step that decides whether a metric sample matches an alert rule.
The evaluator guards on domain/metric alignment, treats non-AVAILABLE
samples specially and compares values against the normalized threshold with a
fixed operator set. The tests pin the guard rails, the availability semantics
and every comparison operator.
### Changes
-
`server/src/test/java/org/apache/rocketmq/studio/ops/alert/AlertRuleEvaluatorTest.java`
- `mismatchingMetricDoesNotMatch` / `mismatchingDomainDoesNotMatch`:
alignment guards.
- `unavailableSampleOnlyMatchesUnavailableOperator`: UNAVAILABLE samples
only fire with the UNAVAILABLE operator.
- `greaterThanComparesAgainstThreshold` /
`equalityOperatorUsesDoubleCompare` / `notEqualsOperatorDetectsDifference`:
numeric operators.
- `unknownOrNullOperatorNeverMatches`: unknown operators never fire.
- `nullRuleOrSampleDoesNotMatch`: degenerate inputs stay safe.
- `nullDomainDefaultsToBusiness`: a missing domain resolves to BUSINESS.
### Testing
- `mvn -B test -Dtest=AlertRuleEvaluatorTest` passes (9 tests, all green).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]