Yuanhong-Zheng opened a new issue, #11611:
URL: https://github.com/apache/rocketmq/issues/11611

   ### Before Creating the Enhancement Request
   
   - [x] I have confirmed that this should be classified as an enhancement 
rather than a bug/feature.
   
   ### Summary
   
   Add focused regression tests for `StatisticsBriefInterceptor` in 
`rocketmq-common`.
   
   ### Motivation
   
   The broker's statistics code selects the fields to sample by name, and the 
scheduled printer reports and resets those samples each interval. 
`StatisticsBriefTest` covers the histogram itself. There is no direct test for 
the interceptor that maps named item values to those histograms. A regression 
in that mapping or interval reset could lead to misleading statistics.
   
   ### Describe the Solution You'd Like
   
   Exercise the interceptor through `StatisticsItem.incItems()` with the 
metadata in a different order from the item fields. Verify that an omitted 
value does not count as a sample, an unknown field is rejected, and resetting 
the interceptor clears both configured summaries so subsequent samples start a 
fresh interval.
   
   ### Describe Alternatives You've Considered
   
   Testing the scheduled printer would require executor setup and would cover 
several behaviors in addition to the field mapping. The interceptor can be 
tested deterministically without a broker or scheduled executor.
   
   ### Additional Context
   
   The tests would cover the interceptor separately from the `StatisticsItem` 
accumulator cases in #11604.
   


-- 
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]

Reply via email to