Skip to content

*: add p2p send duration metric#4506

Merged
KaloyanTanev merged 3 commits intomainfrom
kalo/p2p-send-metric
May 1, 2026
Merged

*: add p2p send duration metric#4506
KaloyanTanev merged 3 commits intomainfrom
kalo/p2p-send-metric

Conversation

@KaloyanTanev
Copy link
Copy Markdown
Collaborator

Add p2p send duration histogram with topic labels. This can help us debug potential contentions.

category: feature
ticket: none

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a Prometheus histogram to measure wall-clock duration of p2p sends (both Send and SendReceive) and introduces an optional “topic” label to segment timings by sub-protocol/message type.

Changes:

  • Add p2p_send_duration_seconds histogram with peer, protocol, and topic labels.
  • Add WithSendMetricTopic option and plumb metric-topic support through p2p send options.
  • Populate topic labels from key call sites (QBFT, ParSigEx, PeerInfo, Priority).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
p2p/sender.go Adds metric-topic option and records send duration for Send/SendReceive.
p2p/metrics.go Defines new p2p_send_duration_seconds histogram (peer/protocol/topic).
core/priority/prioritiser.go Tags priority exchange sends with priority_consensus topic.
core/parsigex/parsigex.go Tags ParSigEx broadcasts with duty-type-derived topic.
core/consensus/qbft/qbft.go Tags QBFT broadcasts with message-type-derived topic.
app/peerinfo/peerinfo.go Tags periodic peerinfo requests with peerinfo topic.
app/peerinfo/adhoc.go Tags ad-hoc peerinfo request with peerinfo_adhoc topic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread p2p/metrics.go
Comment thread p2p/metrics.go Outdated
Comment thread p2p/sender.go
Comment thread p2p/sender.go
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread p2p/sender.go
Comment thread p2p/sender.go
Comment thread p2p/sender.go Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: kalo <24719519+KaloyanTanev@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 1, 2026

@KaloyanTanev KaloyanTanev enabled auto-merge (squash) May 1, 2026 13:18
@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

❌ Patch coverage is 79.16667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.11%. Comparing base (b35fc00) to head (27e83ad).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
p2p/sender.go 82.35% 3 Missing ⚠️
core/consensus/qbft/qbft.go 50.00% 0 Missing and 1 partial ⚠️
core/parsigex/parsigex.go 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4506   +/-   ##
=======================================
  Coverage   57.11%   57.11%           
=======================================
  Files         245      245           
  Lines       32920    32939   +19     
=======================================
+ Hits        18801    18813   +12     
- Misses      11752    11758    +6     
- Partials     2367     2368    +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@KaloyanTanev KaloyanTanev merged commit 1ee6f85 into main May 1, 2026
10 of 11 checks passed
@KaloyanTanev KaloyanTanev deleted the kalo/p2p-send-metric branch May 1, 2026 13:25
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.

3 participants