expose basic connection stats via Conn.ConnectionStats (#5281)

* Add ConnectionStats

* remove for loop

* Add comments

* Update comments

---------

Co-authored-by: Marco Munizaga <git@marcopolo.io>
This commit is contained in:
Marten Seemann
2025-08-13 16:45:14 +02:00
committed by GitHub
parent e0a836f597
commit da27fcf33f
9 changed files with 169 additions and 28 deletions

View File

@@ -0,0 +1,14 @@
package utils
import "sync/atomic"
// ConnectionStats stores stats for the connection. See the public
// ConnectionStats struct in connection.go for more information
type ConnectionStats struct {
BytesSent atomic.Uint64
PacketsSent atomic.Uint64
BytesReceived atomic.Uint64
PacketsReceived atomic.Uint64
BytesLost atomic.Uint64
PacketsLost atomic.Uint64
}