1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-05 11:21:09 +03:00

Adding packet rtt sampling to instrumentationObserver (#178)

Summary:
Due to high number of RTT samples I refactored the OutstandingPacket to
split the packet data and packet metrics. We know have access to metrics
without the need of saving the packet data.

Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/178

Reviewed By: mjoras

Differential Revision: D23711641

Pulled By: bschlinker

fbshipit-source-id: 53791f1f6f6e184f37afca991a873af05909fbd2
This commit is contained in:
vaz985
2020-09-22 18:37:25 -07:00
committed by Facebook GitHub Bot
parent 7076092dd9
commit a8d5c156a1
34 changed files with 451 additions and 202 deletions

View File

@@ -367,7 +367,7 @@ TEST_F(QuicTransportFunctionsTest, TestUpdateConnectionD6DNotConsumeSendPing) {
conn->d6d.lastProbe = QuicConnectionStateBase::D6DProbePacket(packetNum, 50);
updateConnection(*conn, folly::none, packet.packet, Clock::now(), 50);
EXPECT_EQ(1, conn->outstandings.packets.size());
EXPECT_TRUE(conn->outstandings.packets.front().isD6DProbe);
EXPECT_TRUE(conn->outstandings.packets.front().metadata.isD6DProbe);
EXPECT_EQ(1, conn->d6d.outstandingProbes);
// sendPing should still be active since d6d probe should be "hidden" from
// application
@@ -959,7 +959,7 @@ TEST_F(QuicTransportFunctionsTest, TestUpdateConnectionWithBytesStats) {
EXPECT_EQ(
13579 + 555,
getFirstOutstandingPacket(*conn, PacketNumberSpace::Handshake)
->totalBytesSent);
->metadata.totalBytesSent);
EXPECT_TRUE(getFirstOutstandingPacket(*conn, PacketNumberSpace::Handshake)
->lastAckedPacketInfo.has_value());
EXPECT_EQ(
@@ -1025,10 +1025,12 @@ TEST_F(QuicTransportFunctionsTest, TestUpdateConnectionWithCloneResult) {
EXPECT_EQ(frame->maximumData, maxDataAmt);
EXPECT_EQ(
futureMoment,
getLastOutstandingPacket(*conn, PacketNumberSpace::AppData)->time);
getLastOutstandingPacket(*conn, PacketNumberSpace::AppData)
->metadata.time);
EXPECT_EQ(
1500,
getLastOutstandingPacket(*conn, PacketNumberSpace::AppData)->encodedSize);
getLastOutstandingPacket(*conn, PacketNumberSpace::AppData)
->metadata.encodedSize);
EXPECT_EQ(
event,
*getLastOutstandingPacket(*conn, PacketNumberSpace::AppData)
@@ -1676,7 +1678,7 @@ TEST_F(QuicTransportFunctionsTest, TestCryptoWritingIsHandshakeInOutstanding) {
conn->transportSettings.writeConnectionDataPacketsLimit));
ASSERT_EQ(1, conn->outstandings.packets.size());
EXPECT_TRUE(getFirstOutstandingPacket(*conn, PacketNumberSpace::Initial)
->isHandshake);
->metadata.isHandshake);
}
TEST_F(QuicTransportFunctionsTest, NoCryptoProbeWriteIfNoProbeCredit) {
@@ -1702,7 +1704,7 @@ TEST_F(QuicTransportFunctionsTest, NoCryptoProbeWriteIfNoProbeCredit) {
conn->transportSettings.writeConnectionDataPacketsLimit));
ASSERT_EQ(1, conn->outstandings.packets.size());
EXPECT_TRUE(getFirstOutstandingPacket(*conn, PacketNumberSpace::Initial)
->isHandshake);
->metadata.isHandshake);
ASSERT_EQ(1, cryptoStream->retransmissionBuffer.size());
ASSERT_TRUE(cryptoStream->writeBuffer.empty());
@@ -2474,7 +2476,8 @@ TEST_F(QuicTransportFunctionsTest, WriteProbingWithInplaceBuilder) {
ASSERT_FALSE(streamScheduler.hasPendingData());
// The first packet has be a full packet
auto firstPacketSize = conn->outstandings.packets.front().encodedSize;
auto firstPacketSize =
conn->outstandings.packets.front().metadata.encodedSize;
auto outstandingPacketsCount = conn->outstandings.packets.size();
ASSERT_EQ(firstPacketSize, conn->udpSendPacketLen);
EXPECT_CALL(mockSock, write(_, _))