forked from quic-go/quic-go
move the TransportState struct to the quictrace package
Prevents an import loop when passing the tracer to the ackhandler.
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
|
||||
"github.com/lucas-clemente/quic-go/internal/protocol"
|
||||
"github.com/lucas-clemente/quic-go/internal/wire"
|
||||
"github.com/lucas-clemente/quic-go/quictrace"
|
||||
)
|
||||
|
||||
// SentPacketHandler handles ACKs received for outgoing packets
|
||||
@@ -41,7 +42,7 @@ type SentPacketHandler interface {
|
||||
OnAlarm() error
|
||||
|
||||
// report some congestion statistics. For tracing only.
|
||||
GetStats() *State
|
||||
GetStats() *quictrace.TransportState
|
||||
}
|
||||
|
||||
// ReceivedPacketHandler handles ACKs needed to send for incoming packets
|
||||
@@ -53,12 +54,3 @@ type ReceivedPacketHandler interface {
|
||||
GetAlarmTimeout() time.Time
|
||||
GetAckFrame(protocol.EncryptionLevel) *wire.AckFrame
|
||||
}
|
||||
|
||||
type State struct {
|
||||
MinRTT time.Duration
|
||||
SmoothedRTT time.Duration
|
||||
LatestRTT time.Duration
|
||||
|
||||
BytesInFlight protocol.ByteCount
|
||||
CongestionWindow protocol.ByteCount
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/lucas-clemente/quic-go/internal/qerr"
|
||||
"github.com/lucas-clemente/quic-go/internal/utils"
|
||||
"github.com/lucas-clemente/quic-go/internal/wire"
|
||||
"github.com/lucas-clemente/quic-go/quictrace"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -671,8 +672,8 @@ func (h *sentPacketHandler) ResetForRetry() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (h *sentPacketHandler) GetStats() *State {
|
||||
return &State{
|
||||
func (h *sentPacketHandler) GetStats() *quictrace.TransportState {
|
||||
return &quictrace.TransportState{
|
||||
MinRTT: h.rttStats.MinRTT(),
|
||||
SmoothedRTT: h.rttStats.SmoothedOrInitialRTT(),
|
||||
LatestRTT: h.rttStats.LatestRTT(),
|
||||
|
||||
Reference in New Issue
Block a user