Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[testclient] Multiple calls to printAggregatedStats result in inaccur… #13292

Merged
merged 1 commit into from
Dec 14, 2021

Conversation

tomscut
Copy link
Contributor

@tomscut tomscut commented Dec 14, 2021

Fixes #ISSUE-13250

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
  • no-need-doc
  • doc

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Dec 14, 2021
@tomscut
Copy link
Contributor Author

tomscut commented Dec 14, 2021

Thanks @merlimat and @yuruguo for your review.

@merlimat merlimat added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label Dec 14, 2021
@merlimat merlimat modified the milestones: 2.9.0, 2.10.0 Dec 14, 2021
@merlimat merlimat merged commit c1cd085 into apache:master Dec 14, 2021
fxbing pushed a commit to fxbing/pulsar that referenced this pull request Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
3 participants