Skip to content

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

Closed

Description

@frankjkelly

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

Activity

  1. added
    type/enhancement
    on Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions