Skip to content

Count packets sent and received on Conn - #1046

Open
fippo wants to merge 2 commits into
mainfrom
conn-packet-counts
Open

fippo wants to merge 2 commits into
mainfrom
conn-packet-counts

Conversation

@fippo

@fippo fippo commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Add PacketsSent and PacketsReceived next to the byte counters so transport stats can report packet counts. Like the byte counters they do not include ICE connectivity checks.

Add PacketsSent and PacketsReceived next to the byte counters so
transport stats can report packet counts. Like the byte counters
they do not include ICE connectivity checks.
@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.64%. Comparing base (2981def) to head (2b4d417).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1046      +/-   ##
==========================================
- Coverage   91.66%   91.64%   -0.02%     
==========================================
  Files          45       45              
  Lines        5456     5461       +5     
==========================================
+ Hits         5001     5005       +4     
- Misses        455      456       +1     
Flag Coverage Δ
go 91.64% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

Comment thread transport.go
bytesSent atomic.Uint64
packetsReceived atomic.Uint64
packetsSent atomic.Uint64
agent *Agent

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it feels like agent should come first here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'll add a lint rule for this soon, also fieldalignment (wouldn't matter here since both orders are the same on 64), but i need to make the lint able to do --fix in the CI first

@JoTurk
JoTurk self-requested a review November 3, 2026 00:09

@JoTurk JoTurk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It would have been nice if we could export a single stats object but i think this is fine and the overhead for a struct is probably a bad idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants