logging / qlog: add support for DPLPMTUD (#4517)

* logging / qlog: add support for DPLPMTUD

* improve the MTU discovery integration test
This commit is contained in:
Marten Seemann
2024-05-14 17:37:54 +08:00
committed by GitHub
parent 056a332ac4
commit e41d1f9dd7
12 changed files with 157 additions and 11 deletions

View File

@@ -24,6 +24,7 @@ type ConnectionTracer struct {
UpdatedMetrics func(rttStats *RTTStats, cwnd, bytesInFlight ByteCount, packetsInFlight int)
AcknowledgedPacket func(EncryptionLevel, PacketNumber)
LostPacket func(EncryptionLevel, PacketNumber, PacketLossReason)
UpdatedMTU func(mtu ByteCount, done bool)
UpdatedCongestionState func(CongestionState)
UpdatedPTOCount func(value uint32)
UpdatedKeyFromTLS func(EncryptionLevel, Perspective)
@@ -168,6 +169,13 @@ func NewMultiplexedConnectionTracer(tracers ...*ConnectionTracer) *ConnectionTra
}
}
},
UpdatedMTU: func(mtu ByteCount, done bool) {
for _, t := range tracers {
if t.UpdatedMTU != nil {
t.UpdatedMTU(mtu, done)
}
}
},
UpdatedCongestionState: func(state CongestionState) {
for _, t := range tracers {
if t.UpdatedCongestionState != nil {

View File

@@ -201,6 +201,12 @@ var _ = Describe("Tracing", func() {
tracer.DroppedPacket(PacketTypeInitial, 42, 1337, PacketDropHeaderParseError)
})
It("traces the UpdatedMTU event", func() {
tr1.EXPECT().UpdatedMTU(ByteCount(1337), true)
tr2.EXPECT().UpdatedMTU(ByteCount(1337), true)
tracer.UpdatedMTU(1337, true)
})
It("traces the UpdatedCongestionState event", func() {
tr1.EXPECT().UpdatedCongestionState(CongestionStateRecovery)
tr2.EXPECT().UpdatedCongestionState(CongestionStateRecovery)