In quic, record the max consecutive retransmission timeout before making forward progress. stats only change, not protected.
This number will be recorded in TCS on server side, and will be used to populate histogram on client side.
PiperOrigin-RevId: 312123618
Change-Id: I5cd34b2d1559305b2825f6997bc4d7a5c4e2faf8
diff --git a/quic/core/quic_sent_packet_manager_test.cc b/quic/core/quic_sent_packet_manager_test.cc
index 7692c49..d479c68 100644
--- a/quic/core/quic_sent_packet_manager_test.cc
+++ b/quic/core/quic_sent_packet_manager_test.cc
@@ -942,6 +942,7 @@
manager_.OnRetransmissionTimeout();
EXPECT_EQ(2u, stats_.tlp_count);
EXPECT_EQ(1u, stats_.rto_count);
+ EXPECT_EQ(0u, stats_.max_consecutive_rto_with_forward_progress);
// There are 2 RTO retransmissions.
EXPECT_EQ(104 * kDefaultLength, manager_.GetBytesInFlight());
QuicPacketNumber largest_acked = QuicPacketNumber(103);
@@ -965,6 +966,7 @@
// All packets before 103 should be lost.
// Packet 104 is still in flight.
EXPECT_EQ(1000u, manager_.GetBytesInFlight());
+ EXPECT_EQ(1u, stats_.max_consecutive_rto_with_forward_progress);
}
TEST_F(QuicSentPacketManagerTest, CryptoHandshakeTimeout) {
@@ -2732,6 +2734,7 @@
manager_.OnRetransmissionTimeout();
EXPECT_EQ(QuicTime::Delta::Zero(), manager_.TimeUntilSend(clock_.Now()));
EXPECT_EQ(1u, stats_.pto_count);
+ EXPECT_EQ(0u, stats_.max_consecutive_rto_with_forward_progress);
// Verify two probe packets get sent.
EXPECT_CALL(notifier_, RetransmitFrames(_, _))
@@ -2765,6 +2768,7 @@
// Verify PTO is correctly re-armed based on sent time of packet 4.
EXPECT_EQ(sent_time + expected_pto_delay, manager_.GetRetransmissionTime());
+ EXPECT_EQ(1u, stats_.max_consecutive_rto_with_forward_progress);
}
TEST_F(QuicSentPacketManagerTest, SendOneProbePacket) {