RockteMQ-AI commented on issue #11321:
URL: https://github.com/apache/rocketmq/issues/11321#issuecomment-6110394743
**Issue Evaluation**
Category: `type/bug` | Status: **Confirmed**
The loop condition `i > 0` in `StatisticsBrief.getTPValue` (line 115)
excludes bucket 0 from the percentile scan. When all samples fall into the
first bucket, the loop never accumulates enough to exceed `excludes`, and the
method falls through to `return 0`.
**Root Cause:** Off-by-one in the loop bound — should be `i >= 0` instead of
`i > 0`.
**Impact:** Any metric whose whole population sits in the first latency
bucket reports zero percentiles (TP50, TP99, TP999 all return 0). This affects
`StatisticsBriefInterceptor` / `StatisticsManager` percentile output, making
latency metrics silently wrong for low-latency workloads.
**Severity:** Medium — incorrect metrics output, not data loss, but can
mislead capacity planning and SLA monitoring.
**Reproduction:** Sample value `5` one hundred times with meta `{{100, 10}}`
— `getTPValue(0.99f)` returns 0 instead of the expected bucket-0 upper bound.
An automated fix proposal can be generated. Reply `/approve` to proceed with
PR generation.
---
*Automated evaluation by RocketMQ-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]