mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 04:07:35 +03:00
add a function to trace acknowledged packets
This commit is contained in:
parent
e098ccd2b3
commit
875692ea10
9 changed files with 44 additions and 0 deletions
|
@ -115,6 +115,7 @@ type ConnectionTracer interface {
|
|||
BufferedPacket(PacketType)
|
||||
DroppedPacket(PacketType, ByteCount, PacketDropReason)
|
||||
UpdatedMetrics(rttStats *RTTStats, cwnd, bytesInFlight ByteCount, packetsInFlight int)
|
||||
AcknowledgedPacket(EncryptionLevel, PacketNumber)
|
||||
LostPacket(EncryptionLevel, PacketNumber, PacketLossReason)
|
||||
UpdatedCongestionState(CongestionState)
|
||||
UpdatedPTOCount(value uint32)
|
||||
|
|
|
@ -38,6 +38,18 @@ func (m *MockConnectionTracer) EXPECT() *MockConnectionTracerMockRecorder {
|
|||
return m.recorder
|
||||
}
|
||||
|
||||
// AcknowledgedPacket mocks base method.
|
||||
func (m *MockConnectionTracer) AcknowledgedPacket(arg0 protocol.EncryptionLevel, arg1 protocol.PacketNumber) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "AcknowledgedPacket", arg0, arg1)
|
||||
}
|
||||
|
||||
// AcknowledgedPacket indicates an expected call of AcknowledgedPacket.
|
||||
func (mr *MockConnectionTracerMockRecorder) AcknowledgedPacket(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AcknowledgedPacket", reflect.TypeOf((*MockConnectionTracer)(nil).AcknowledgedPacket), arg0, arg1)
|
||||
}
|
||||
|
||||
// BufferedPacket mocks base method.
|
||||
func (m *MockConnectionTracer) BufferedPacket(arg0 protocol.PacketType) {
|
||||
m.ctrl.T.Helper()
|
||||
|
|
|
@ -139,6 +139,12 @@ func (m *connTracerMultiplexer) UpdatedMetrics(rttStats *RTTStats, cwnd, bytesIn
|
|||
}
|
||||
}
|
||||
|
||||
func (m *connTracerMultiplexer) AcknowledgedPacket(encLevel EncryptionLevel, pn PacketNumber) {
|
||||
for _, t := range m.tracers {
|
||||
t.AcknowledgedPacket(encLevel, pn)
|
||||
}
|
||||
}
|
||||
|
||||
func (m *connTracerMultiplexer) LostPacket(encLevel EncryptionLevel, pn PacketNumber, reason PacketLossReason) {
|
||||
for _, t := range m.tracers {
|
||||
t.LostPacket(encLevel, pn, reason)
|
||||
|
|
|
@ -190,6 +190,12 @@ var _ = Describe("Tracing", func() {
|
|||
tracer.UpdatedMetrics(rttStats, 1337, 42, 13)
|
||||
})
|
||||
|
||||
It("traces the AcknowledgedPacket event", func() {
|
||||
tr1.EXPECT().AcknowledgedPacket(EncryptionHandshake, PacketNumber(42))
|
||||
tr2.EXPECT().AcknowledgedPacket(EncryptionHandshake, PacketNumber(42))
|
||||
tracer.AcknowledgedPacket(EncryptionHandshake, 42)
|
||||
})
|
||||
|
||||
It("traces the LostPacket event", func() {
|
||||
tr1.EXPECT().LostPacket(EncryptionHandshake, PacketNumber(42), PacketLossReorderingThreshold)
|
||||
tr2.EXPECT().LostPacket(EncryptionHandshake, PacketNumber(42), PacketLossReorderingThreshold)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue