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

Add support for detecting start and stop of app rate limited scenarios

Summary:
Previously, we only had support for notifying observers when a QUIC socket
became application rate limited.

This change adds a similar notification when a socket does not become
application rate limited, i.e when the application *starts* writing data to the
socket - either for the first time on a newly established socket or after a
previous block of writes were written and the app had no more to write.
In addition, we include the number of outstanding packets (only those that are
carrying app data in them) so that observers can use this data to timestamp the
start and end of periods where the socket performs app data writes.

Reviewed By: yangchi

Differential Revision: D26559598

fbshipit-source-id: 0a8df7082b83e2ffad9b5addceca29cc03897243
This commit is contained in:
Sridhar Srinivasan
2021-03-10 13:03:30 -08:00
committed by Facebook GitHub Bot
parent 3c350f5256
commit d2f005dc00
12 changed files with 168 additions and 22 deletions

View File

@@ -41,7 +41,7 @@ PacketNum addInitialOutstandingPacket(QuicConnectionStateBase& conn) {
QuicVersion::QUIC_DRAFT);
RegularQuicWritePacket packet(std::move(header));
conn.outstandings.packets.emplace_back(
packet, Clock::now(), 0, true, 0, 0, 0, LossState());
packet, Clock::now(), 0, true, 0, 0, 0, LossState(), 0);
conn.outstandings.handshakePacketsCount++;
increaseNextPacketNum(conn, PacketNumberSpace::Handshake);
return nextPacketNum;
@@ -60,7 +60,7 @@ PacketNum addHandshakeOutstandingPacket(QuicConnectionStateBase& conn) {
QuicVersion::QUIC_DRAFT);
RegularQuicWritePacket packet(std::move(header));
conn.outstandings.packets.emplace_back(
packet, Clock::now(), 0, true, 0, 0, 0, LossState());
packet, Clock::now(), 0, true, 0, 0, 0, LossState(), 0);
conn.outstandings.handshakePacketsCount++;
increaseNextPacketNum(conn, PacketNumberSpace::Handshake);
return nextPacketNum;
@@ -74,7 +74,7 @@ PacketNum addOutstandingPacket(QuicConnectionStateBase& conn) {
nextPacketNum);
RegularQuicWritePacket packet(std::move(header));
conn.outstandings.packets.emplace_back(
packet, Clock::now(), 0, false, 0, 0, 0, LossState());
packet, Clock::now(), 0, false, 0, 0, 0, LossState(), 0);
increaseNextPacketNum(conn, PacketNumberSpace::AppData);
return nextPacketNum;
}