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

Update Producer stats on producer flush() or close() #12426

Closed
frankjkelly opened this issue Oct 19, 2021 · 0 comments · Fixed by #12500
Closed

Update Producer stats on producer flush() or close() #12426

frankjkelly opened this issue Oct 19, 2021 · 0 comments · Fixed by #12500
Labels
type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

Comments

@frankjkelly
Copy link
Contributor

frankjkelly commented Oct 19, 2021

Is your enhancement request related to a problem? Please describe.
The default producer stats update period is 60 seconds

/**
* Stats will be activated with positive statsIntervalSeconds
*
* @return the interval between each stat info <i>(default: 60 seconds)</i>
*/
public long getStatsIntervalSeconds() {
return confData.getStatsIntervalSeconds();
}

if you have a short-lived producer (lasts less than 60 seconds) then the quantile latencies will not get updated and you will see 0 values for the latencies

synchronized (ds) {
latencyPctValues = ds.getQuantiles(PERCENTILES);
ds.reset();
}

Describe the solution you'd like
It would be nice on Producer flush() or close() to capture the complete final state of the statistics (including the latencies)
Say perhaps on close() here
https://github.com/apache/pulsar/blob/v2.7.2/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java#L842

Describe alternatives you've considered
Not aware of alternatives but perhaps others are

@frankjkelly frankjkelly added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant