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: Add algod_network_p2p_* traffic metrics #6105

Merged
merged 16 commits into from
Aug 29, 2024

Conversation

algorandskiy
Copy link
Contributor

@algorandskiy algorandskiy commented Aug 19, 2024

Summary

This is a part 2 of the P2P metrics enhancement (followup to the #6104)

  • Moded wsNetwork and wsPeer metrics to network/metrics.go since they now also p2p metrics
  • Added algod_network_p2p_received_bytes_{TAG}, algod_network_p2p_sent_bytes_{TAG}, algod_network_p2p_message_sent_{TAG}, algod_network_p2p_message_received_{TAG}
  • wsPeer now increments algod_network_p2p_ or algod_network_ counters based on a node type.
  • pubsubMetricsTracer increments *_TX counters.

pubsubMetricsTracer has hardcoded TX to TXTopicName mapping because of these reasons:

  1. Comparison against a string constant *rpc.Publish[i].Topic == TXTopicName is optimized down to two comparison instructions: length and data (given the topic name is 8 bytes).

Test Plan

  • Tested locally with goal network + pingpong + test/heapwatch/heapWatch.py --period 10 --metrics and observed
algod_network_p2p_received_bytes_TX 21116548
algod_network_p2p_sent_bytes_TX 58485052
algod_network_p2p_message_sent_TX 17812
algod_network_p2p_message_received_TX 6730
  • Tested with algonet to get P2P vs WS bandwidth numbers.

@algorandskiy algorandskiy added Enhancement p2p Work related to the p2p project labels Aug 19, 2024
@algorandskiy algorandskiy requested review from cce and gmalouf August 19, 2024 21:39
@algorandskiy algorandskiy self-assigned this Aug 19, 2024
Copy link

codecov bot commented Aug 19, 2024

Codecov Report

Attention: Patch coverage is 71.59091% with 25 lines in your changes missing coverage. Please review.

Project coverage is 56.30%. Comparing base (8e2e2e4) to head (edc2d0c).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
network/metrics.go 65.51% 20 Missing ⚠️
network/p2p/pubsub.go 0.00% 3 Missing ⚠️
network/p2p/p2p.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6105      +/-   ##
==========================================
+ Coverage   56.22%   56.30%   +0.08%     
==========================================
  Files         490      490              
  Lines       69705    69746      +41     
==========================================
+ Hits        39191    39271      +80     
+ Misses      27840    27809      -31     
+ Partials     2674     2666       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@algorandskiy algorandskiy force-pushed the pavel/p2p-network-metrics branch from 34f8746 to 0fe5308 Compare August 19, 2024 23:56
network/metrics.go Outdated Show resolved Hide resolved
network/p2p/pubsubTracer.go Outdated Show resolved Hide resolved
network/wsPeer.go Outdated Show resolved Hide resolved
network/p2p/pubsubTracer.go Outdated Show resolved Hide resolved
@algorandskiy algorandskiy requested a review from cce August 21, 2024 19:10
@algorandskiy algorandskiy changed the title p2p: Add algod_network_p2p_sent_bytes_{TAG} metrics p2p: Add algod_network_p2p_* traffic metrics Aug 21, 2024
@algorandskiy algorandskiy force-pushed the pavel/p2p-network-metrics branch from 1cc9a9c to c95cb91 Compare August 22, 2024 21:46
@algorandskiy algorandskiy force-pushed the pavel/p2p-network-metrics branch from ca25a1a to 72f89c8 Compare August 23, 2024 01:37
@algorandskiy algorandskiy requested a review from cce August 26, 2024 20:07
network/wsPeer.go Show resolved Hide resolved
@algorandskiy algorandskiy merged commit f6c59a4 into algorand:master Aug 29, 2024
18 checks passed
@cce cce mentioned this pull request Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement p2p Work related to the p2p project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants