tomscut opened a new pull request #13292:
URL: https://github.com/apache/pulsar/pull/13292


   
   Fixes [#ISSUE-13250](https://github.com/streamnative/pulsar/issues/3409)
   
   ### Motivation
   
   We repeatedly call `#printAggregatedStats` in those places, which ultimately 
calls `Record#getIntervalHistogram`. The `startTimestamp` and `endTimestamp` 
will be reset, which may result in inconsistent results of multiple access. 
   
   We should only call printAggregatedStats once inside `ShutdownHook`, like 
`PerformanceClient`.
   
   ```
   Runtime.getRuntime().addShutdownHook(new Thread(() -> {
       printAggregatedThroughput(start);
       printAggregatedStats();
   }));
   ```
   
   ### Modifications
   
   Remove redundant calls to `#printAggregatedStats`.
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API: (no)
     - The schema: (no)
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   
   ### Documentation
   - [ ] `doc-required` 
   - [x] `no-need-doc` 
   - [ ] `doc` 
    
   
   
   


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