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

Fix max upper bound for last bucket of timer stats #3543

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ghatage
Copy link
Contributor

@Ghatage Ghatage commented Oct 17, 2022

Descriptions of the changes in this PR:

Motivation

Codahale metrics are used for dashboarding with Grafana and we must rely on these values to be accurate in order to measure the stability and performance of the service.
For Codahale's fast timer, when a value falls in the last bucket, the max is reported as the upper bound of the last bucket (Long.MAX_VALUE) which can lead to erroneous 99 percentile values.

Changes

We change the way we get the max value recorded if the bucket we're dealing with is the last bucket (for 99th percentile).
If we are in the last bucket, we return the actual max, otherwise we can return getBucketBound() which should return the accurate calculated value.
Also added a test.

@Ghatage Ghatage self-assigned this Oct 17, 2022
@hangc0276 hangc0276 added this to the 4.16.0 milestone Jan 11, 2023
@hangc0276
Copy link
Contributor

@Ghatage Thanks for your contribution, would you please help resolve the conflicts? Thanks a lot.

@hangc0276 hangc0276 modified the milestones: 4.16.0, 4.17.0 Mar 13, 2023
Make sure the 99th percentile is reported as the actually recorded max (not as upper bucket bound Long.MAX_VALUE)
@Ghatage
Copy link
Contributor Author

Ghatage commented Dec 20, 2023

Hi @hangc0276 somehow I missed the comment, sorry for that. Fixing the conflicts and getting this PR ready to go.

@Ghatage
Copy link
Contributor Author

Ghatage commented Apr 1, 2024

@hangc0276 can you PTAL?

@eolivelli eolivelli removed this from the 4.17.0 milestone May 3, 2024
@Ghatage
Copy link
Contributor Author

Ghatage commented Jul 12, 2024

@eolivelli @nicoloboschi @merlimat PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants