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

@@ -2,6 +2,7 @@ package protocol
import (
"fmt"
"sync/atomic"
"time"
)
@@ -95,6 +96,8 @@ func (e ECN) String() string {
// A ByteCount in QUIC
type ByteCount int64
type AtomicByteCount atomic.Int64
// MaxByteCount is the maximum value of a ByteCount
const MaxByteCount = ByteCount(1<<62 - 1)