-
Notifications
You must be signed in to change notification settings - Fork 20k
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
Conversation
|
||
func newMeteredConn(conn UDPConn) UDPConn { | ||
// Short circuit if metrics are disabled | ||
if !metrics.Enabled { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Co-authored-by: Exca-DK <dev@DESKTOP-RI45P4J.localdomain> Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: Exca-DK <dev@DESKTOP-RI45P4J.localdomain> Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
This reverts commit 11fafa4.
This reverts commit 11fafa4.
Co-authored-by: Exca-DK <dev@DESKTOP-RI45P4J.localdomain> Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
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.