metrics/prometheus: fix count field of metric#965
Merged
manav2401 merged 1 commit intov0.5.0-beta-candidate-2from Aug 16, 2023
Merged
metrics/prometheus: fix count field of metric#965manav2401 merged 1 commit intov0.5.0-beta-candidate-2from
manav2401 merged 1 commit intov0.5.0-beta-candidate-2from
Conversation
marcello33
approved these changes
Aug 16, 2023
pratikspatil024
approved these changes
Aug 16, 2023
0xsharma
approved these changes
Aug 16, 2023
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## v0.5.0-beta-candidate-2 #965 +/- ##
==========================================================
Coverage ? 57.11%
==========================================================
Files ? 633
Lines ? 77332
Branches ? 0
==========================================================
Hits ? 44168
Misses ? 29404
Partials ? 3760 ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
With changes done in #881 and #893, the
countfield of a metric was added into summary and was calculated in wrong way. The tests didn't complain as they were updated in few places to cater to the new logic or the values according to the new logic vs old logic turned out to be same for the test caseE.g. histogram count should be ideally 0 as no values are reported but it was changed to 6 which actually denotes the total percentile values reported. In case of timers, the values reported were 6 and the percentiles were also 6 so the test didn't catch this check.
This PR updates (or actually reverts) the reporting of count metric. Instead of reporting count as
len(values)where values are the total percentiles reported, we fetch it directly frommetric.Count()function as earlier (and also similar to how geth does).Changes
Breaking changes
Please complete this section if any breaking changes have been made, otherwise delete it
Nodes audience
In case this PR includes changes that must be applied only to a subset of nodes, please specify how you handled it (e.g. by adding a flag with a default value...)
Checklist
Cross repository changes
Testing
Manual tests
Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it
Additional comments
Please post additional comments in this section if you have them, otherwise delete it