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

p2p/discover: add traffic metrics #27008

Merged
merged 3 commits into from
Apr 25, 2023
Merged

p2p/discover: add traffic metrics #27008

merged 3 commits into from
Apr 25, 2023

Conversation

Exca-DK
Copy link
Contributor

@Exca-DK Exca-DK commented Mar 29, 2023

This PR adds similar to p2p/metrics metered connection for discovery module. The aim is to have more detailed information about network usage which currently isn't tracked for discV4 and discV5.


func newMeteredConn(conn UDPConn) UDPConn {
// Short circuit if metrics are disabled
if !metrics.Enabled {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not fully sure that we should use metrics.Enabled or metrics.EnabledExpensive.

The former one will be enabled once the metric system is turned on. The latter one is more for debug purpose which might impact runtime performance.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's OK to use metrics.Enabled for discovery. The packet rate is not so high.

@fjl fjl changed the title p2p/discover: add metered conn p2p/discover: add traffic metrics Apr 25, 2023
@fjl fjl merged commit f8f9534 into ethereum:master Apr 25, 2023
@fjl fjl added this to the 1.11.7 milestone Apr 25, 2023
shekhirin pushed a commit to shekhirin/go-ethereum that referenced this pull request Jun 6, 2023
Co-authored-by: Exca-DK <dev@DESKTOP-RI45P4J.localdomain>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
devopsbo3 pushed a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
Co-authored-by: Exca-DK <dev@DESKTOP-RI45P4J.localdomain>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
nibty pushed a commit to FairCrypto/go-ethereum that referenced this pull request Apr 10, 2024
Co-authored-by: Exca-DK <dev@DESKTOP-RI45P4J.localdomain>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
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.

4 participants