nodece opened a new pull request, #26171:
URL: https://github.com/apache/pulsar/pull/26171

   ### Motivation
   
   `BucketDelayedMessageIndexStats` used `LongAdder.sumThenReset()` for 
operation
   counts and `StatsBuckets.refresh()` for latency buckets. Since both reset 
their
   internal counters after reading, every stats collection cleared the 
accumulated
   metrics. As a result, both topic stats and exported metrics only reported 
values
   from the first read after new operations, while subsequent reads returned 
zero
   until more operations occurred.
   
   ### Modifications
   
   * Add `StatsBuckets.snapshot()` to read cumulative values without resetting
     internal counters.
   * Switch `BucketDelayedMessageIndexStats` to use cumulative reads for 
operation
     counts and latency buckets.
   * Add tests covering repeated stats collection.


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