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

DefaultLongTaskTimer histogram bucket counting logic fix #2851

Merged

Conversation

shakuzen
Copy link
Member

@shakuzen shakuzen commented Nov 8, 2021

The histogram was not correct in all cases before. The added test demonstrates a case that would fail with the previous logic. Buckets that should have been zero were not.

I came across this while looking into another bug with LongTaskTimer histograms: #2744

The histogram was not correct in all cases before. The added test demonstrates a case that would fail with the previous logic. Buckets that should have been zero were not.
@shakuzen shakuzen added bug A general bug module: micrometer-core An issue that is related to our core module labels Nov 8, 2021
@shakuzen shakuzen added this to the 1.6.13 milestone Nov 8, 2021
@shakuzen shakuzen changed the base branch from main to 1.6.x November 8, 2021 15:05
@shakuzen
Copy link
Member Author

shakuzen commented Nov 8, 2021

Note: this is a separate issue from #2744. I have another test locally for that issue and will work on a fix for it separate from this change.

We don't want to compare the current bucket to the current duration where the duration is potentially different on each iteration. We get all the durations first and then iterate, which is closer to the expected behavior of a true snapshot.
It's testing logic in the DefaultLongTaskTimer class, so it is more appropriate for it to be in that test class.
@jonatan-ivanov jonatan-ivanov merged commit 42af250 into micrometer-metrics:1.6.x Nov 9, 2021
@shakuzen shakuzen deleted the ltt-histogram-counting branch November 10, 2021 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A general bug module: micrometer-core An issue that is related to our core module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants