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

eth/protocols, metrics: use resetting histograms for rare packets #22586

Merged
merged 1 commit into from
Mar 26, 2021

Conversation

karalabe
Copy link
Member

This PR "fixes" the previous histograms by resetting them upon each pull/push.

The same way as with timers, the metrics library assumes that there's a constant stream of events we monitor. If a metric gets updated very rarely (e.g. eth/64 header request), the chart will be skewed because the metric will report the same value over and over and over ad infinitum (decaying ever so slowly to 0).

This PR uses @nonsense's resetting idea, just for histograms to reset them on retrieval.

Screenshot from 2021-03-26 16-12-10

The diff is visible on the screenshot below. The code was updated to this PR in the middle on the displayed run.

@karalabe karalabe added this to the 1.10.2 milestone Mar 26, 2021
@karalabe karalabe merged commit 6477ea6 into ethereum:master Mar 26, 2021
@karalabe
Copy link
Member Author

@alisscco Please stop spamming or I'll ban you from the repo

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

Successfully merging this pull request may close these issues.

2 participants