RockteMQ-AI commented on issue #4291:
URL:
https://github.com/apache/rocketmq-dashboard/issues/4291#issuecomment-5668425384
**Issue Evaluation**
Category: `bug` | Status: **Confirmed**
The reported issue has been verified against the `rocketmq-studio` branch
codebase.
**Root Cause:**
`AlertNotificationTemplate.java:66` uses plain `double` arithmetic
(`alert.getCurrentValue() * 100`) without rounding when converting ratio
metrics to percentages. This causes floating-point precision artifacts for 8 of
99 possible whole percent values (e.g., `0.29 * 100 = 28.999999999999996`).
**Verification:**
- ✓ File exists at
`server/src/main/java/org/apache/rocketmq/studio/ops/alert/AlertNotificationTemplate.java`
- ✓ Line 66: `return String.valueOf(alert.getCurrentValue() * 100);`
- ✓ `RATIO_METRICS` constant defined at line 18
- ✓ `AlertRuleSemanticFingerprint.java:65-66` divides threshold by 100D (as
reported)
- ✓ No rounding/formatting applied in the notification rendering path
**Impact:**
- Operators see broken-looking numbers in alert notifications (DingTalk,
SMS, email)
- Affects all ratio metrics with `%` unit threshold
- Also affects alert template preview
**Severity:** Medium — cosmetic but affects operator trust in alerting system
**Suggested Fix:**
Use `BigDecimal` or `String.format("%.2f", value)` with trailing zero
stripping to render the shortest exact decimal representation.
An automated fix proposal can be generated. Reply `/approve` to proceed with
PR generation.
---
*Automated evaluation by RockteMQ-AI*
--
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]