log the size of buffered packets (#3571)

This commit is contained in:
Marten Seemann 2022-10-11 12:27:26 +03:00 committed by GitHub
parent 438942b888
commit fe277dc663
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 28 additions and 21 deletions

View file

@ -126,7 +126,7 @@ type ConnectionTracer interface {
ReceivedRetry(*Header)
ReceivedLongHeaderPacket(hdr *ExtendedHeader, size ByteCount, frames []Frame)
ReceivedShortHeaderPacket(hdr *ShortHeader, size ByteCount, frames []Frame)
BufferedPacket(PacketType)
BufferedPacket(PacketType, ByteCount)
DroppedPacket(PacketType, ByteCount, PacketDropReason)
UpdatedMetrics(rttStats *RTTStats, cwnd, bytesInFlight ByteCount, packetsInFlight int)
AcknowledgedPacket(EncryptionLevel, PacketNumber)

View file

@ -51,15 +51,15 @@ func (mr *MockConnectionTracerMockRecorder) AcknowledgedPacket(arg0, arg1 interf
}
// BufferedPacket mocks base method.
func (m *MockConnectionTracer) BufferedPacket(arg0 PacketType) {
func (m *MockConnectionTracer) BufferedPacket(arg0 PacketType, arg1 protocol.ByteCount) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "BufferedPacket", arg0)
m.ctrl.Call(m, "BufferedPacket", arg0, arg1)
}
// BufferedPacket indicates an expected call of BufferedPacket.
func (mr *MockConnectionTracerMockRecorder) BufferedPacket(arg0 interface{}) *gomock.Call {
func (mr *MockConnectionTracerMockRecorder) BufferedPacket(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BufferedPacket", reflect.TypeOf((*MockConnectionTracer)(nil).BufferedPacket), arg0)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BufferedPacket", reflect.TypeOf((*MockConnectionTracer)(nil).BufferedPacket), arg0, arg1)
}
// Close mocks base method.

View file

@ -134,9 +134,9 @@ func (m *connTracerMultiplexer) ReceivedShortHeaderPacket(hdr *ShortHeader, size
}
}
func (m *connTracerMultiplexer) BufferedPacket(typ PacketType) {
func (m *connTracerMultiplexer) BufferedPacket(typ PacketType, size ByteCount) {
for _, t := range m.tracers {
t.BufferedPacket(typ)
t.BufferedPacket(typ, size)
}
}

View file

@ -198,9 +198,9 @@ var _ = Describe("Tracing", func() {
})
It("traces the BufferedPacket event", func() {
tr1.EXPECT().BufferedPacket(PacketTypeHandshake)
tr2.EXPECT().BufferedPacket(PacketTypeHandshake)
tracer.BufferedPacket(PacketTypeHandshake)
tr1.EXPECT().BufferedPacket(PacketTypeHandshake, ByteCount(1337))
tr2.EXPECT().BufferedPacket(PacketTypeHandshake, ByteCount(1337))
tracer.BufferedPacket(PacketTypeHandshake, 1337)
})
It("traces the DroppedPacket event", func() {

View file

@ -41,7 +41,7 @@ func (n NullConnectionTracer) ReceivedVersionNegotiationPacket(dest, src Arbitra
func (n NullConnectionTracer) ReceivedRetry(*Header) {}
func (n NullConnectionTracer) ReceivedLongHeaderPacket(*ExtendedHeader, ByteCount, []Frame) {}
func (n NullConnectionTracer) ReceivedShortHeaderPacket(*ShortHeader, ByteCount, []Frame) {}
func (n NullConnectionTracer) BufferedPacket(PacketType) {}
func (n NullConnectionTracer) BufferedPacket(PacketType, ByteCount) {}
func (n NullConnectionTracer) DroppedPacket(PacketType, ByteCount, PacketDropReason) {}
func (n NullConnectionTracer) UpdatedMetrics(rttStats *RTTStats, cwnd, bytesInFlight ByteCount, packetsInFlight int) {