forked from quic-go/quic-go
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:
@@ -107,6 +107,7 @@ func testSentPacketHandlerSendAndAcknowledge(t *testing.T, encLevel protocol.Enc
|
||||
0,
|
||||
1200,
|
||||
&utils.RTTStats{},
|
||||
&utils.ConnectionStats{},
|
||||
false,
|
||||
false,
|
||||
protocol.PerspectiveClient,
|
||||
@@ -160,6 +161,7 @@ func TestSentPacketHandlerAcknowledgeSkippedPacket(t *testing.T) {
|
||||
0,
|
||||
1200,
|
||||
&utils.RTTStats{},
|
||||
&utils.ConnectionStats{},
|
||||
false,
|
||||
false,
|
||||
protocol.PerspectiveClient,
|
||||
@@ -214,6 +216,7 @@ func testSentPacketHandlerRTTs(t *testing.T, encLevel protocol.EncryptionLevel,
|
||||
0,
|
||||
1200,
|
||||
&rttStats,
|
||||
&utils.ConnectionStats{},
|
||||
false,
|
||||
false,
|
||||
protocol.PerspectiveClient,
|
||||
@@ -253,7 +256,7 @@ func testSentPacketHandlerRTTs(t *testing.T, encLevel protocol.EncryptionLevel,
|
||||
for i := 0; i < 5; i++ {
|
||||
packets = append(packets, sendPacket(now))
|
||||
}
|
||||
expectedRTTStatsNoAckDelay := expectedRTTStats
|
||||
expectedRTTStatsNoAckDelay := expectedRTTStats.Clone()
|
||||
for i := 0; i < 5; i++ {
|
||||
const ackDelay = 500 * time.Millisecond
|
||||
expectedRTTStats.UpdateRTT(time.Duration(i+1)*time.Second, ackDelay)
|
||||
@@ -302,6 +305,7 @@ func testSentPacketHandlerAmplificationLimitServer(t *testing.T, addressValidate
|
||||
0,
|
||||
1200,
|
||||
&utils.RTTStats{},
|
||||
&utils.ConnectionStats{},
|
||||
addressValidated,
|
||||
false,
|
||||
protocol.PerspectiveServer,
|
||||
@@ -371,6 +375,7 @@ func testSentPacketHandlerAmplificationLimitClient(t *testing.T, dropHandshake b
|
||||
0,
|
||||
1200,
|
||||
&utils.RTTStats{},
|
||||
&utils.ConnectionStats{},
|
||||
true,
|
||||
false,
|
||||
protocol.PerspectiveClient,
|
||||
@@ -425,6 +430,7 @@ func TestSentPacketHandlerDelayBasedLossDetection(t *testing.T) {
|
||||
0,
|
||||
1200,
|
||||
&rttStats,
|
||||
&utils.ConnectionStats{},
|
||||
true,
|
||||
false,
|
||||
protocol.PerspectiveServer,
|
||||
@@ -477,6 +483,7 @@ func TestSentPacketHandlerPacketBasedLossDetection(t *testing.T) {
|
||||
0,
|
||||
1200,
|
||||
&rttStats,
|
||||
&utils.ConnectionStats{},
|
||||
true,
|
||||
false,
|
||||
protocol.PerspectiveServer,
|
||||
@@ -541,6 +548,7 @@ func testSentPacketHandlerPTO(t *testing.T, encLevel protocol.EncryptionLevel, p
|
||||
0,
|
||||
1200,
|
||||
&rttStats,
|
||||
&utils.ConnectionStats{},
|
||||
true,
|
||||
false,
|
||||
protocol.PerspectiveServer,
|
||||
@@ -680,6 +688,7 @@ func TestSentPacketHandlerPacketNumberSpacesPTO(t *testing.T) {
|
||||
0,
|
||||
1200,
|
||||
&rttStats,
|
||||
&utils.ConnectionStats{},
|
||||
true,
|
||||
false,
|
||||
protocol.PerspectiveServer,
|
||||
@@ -770,6 +779,7 @@ func TestSentPacketHandler0RTT(t *testing.T) {
|
||||
0,
|
||||
1200,
|
||||
&utils.RTTStats{},
|
||||
&utils.ConnectionStats{},
|
||||
true,
|
||||
false,
|
||||
protocol.PerspectiveClient,
|
||||
@@ -819,6 +829,7 @@ func TestSentPacketHandlerCongestion(t *testing.T) {
|
||||
0,
|
||||
1200,
|
||||
&rttStats,
|
||||
&utils.ConnectionStats{},
|
||||
true,
|
||||
false,
|
||||
protocol.PerspectiveServer,
|
||||
@@ -918,6 +929,7 @@ func testSentPacketHandlerRetry(t *testing.T, rtt, expectedRTT time.Duration) {
|
||||
0,
|
||||
1200,
|
||||
&rttStats,
|
||||
&utils.ConnectionStats{},
|
||||
true,
|
||||
false,
|
||||
protocol.PerspectiveClient,
|
||||
@@ -968,6 +980,7 @@ func TestSentPacketHandlerRetryAfterPTO(t *testing.T) {
|
||||
0,
|
||||
1200,
|
||||
&rttStats,
|
||||
&utils.ConnectionStats{},
|
||||
true,
|
||||
false,
|
||||
protocol.PerspectiveClient,
|
||||
@@ -1011,6 +1024,7 @@ func TestSentPacketHandlerECN(t *testing.T) {
|
||||
0,
|
||||
1200,
|
||||
&utils.RTTStats{},
|
||||
&utils.ConnectionStats{},
|
||||
true,
|
||||
false,
|
||||
protocol.PerspectiveClient,
|
||||
@@ -1113,6 +1127,7 @@ func TestSentPacketHandlerPathProbe(t *testing.T) {
|
||||
0,
|
||||
1200,
|
||||
&rttStats,
|
||||
&utils.ConnectionStats{},
|
||||
true,
|
||||
false,
|
||||
protocol.PerspectiveClient,
|
||||
@@ -1191,6 +1206,7 @@ func TestSentPacketHandlerPathProbeAckAndLoss(t *testing.T) {
|
||||
0,
|
||||
1200,
|
||||
&rttStats,
|
||||
&utils.ConnectionStats{},
|
||||
true,
|
||||
false,
|
||||
protocol.PerspectiveClient,
|
||||
@@ -1265,6 +1281,7 @@ func testSentPacketHandlerRandomized(t *testing.T, seed uint64) {
|
||||
0,
|
||||
1200,
|
||||
&rttStats,
|
||||
&utils.ConnectionStats{},
|
||||
true,
|
||||
false,
|
||||
protocol.PerspectiveClient,
|
||||
|
||||
Reference in New Issue
Block a user