1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-09 20:42:44 +03:00

Add new stream bytes sent per stream

Reviewed By: hanidamlaj

Differential Revision: D43851342

fbshipit-source-id: 204a5d821c69928a4e9de44f461c4eb8181ef277
This commit is contained in:
Crystal Jin
2023-03-08 15:39:11 -08:00
committed by Facebook GitHub Bot
parent 58393be7e4
commit 3c43db2b15
3 changed files with 13 additions and 0 deletions

View File

@@ -670,6 +670,7 @@ void updateConnection(
maybeWriteDataBlockedAfterSocketWrite(conn); maybeWriteDataBlockedAfterSocketWrite(conn);
conn.streamManager->addTx(writeStreamFrame.streamId); conn.streamManager->addTx(writeStreamFrame.streamId);
newStreamBytesSent += writeStreamFrame.len; newStreamBytesSent += writeStreamFrame.len;
stream->newStreamBytesSent += writeStreamFrame.len;
} }
conn.streamManager->updateWritableStreams(*stream); conn.streamManager->updateWritableStreams(*stream);
conn.streamManager->updateLossStreams(*stream); conn.streamManager->updateLossStreams(*stream);

View File

@@ -540,6 +540,9 @@ TEST_F(QuicTransportFunctionsTest, TestUpdateConnectionPacketRetrans) {
// total = 48 // total = 48
EXPECT_EQ(conn->lossState.totalStreamBytesSent, 48); // sum(len) EXPECT_EQ(conn->lossState.totalStreamBytesSent, 48); // sum(len)
EXPECT_EQ(stream1->newStreamBytesSent, 12);
EXPECT_EQ(stream2->newStreamBytesSent, 12);
// totalNewStreamBytesSent: just sum(len) // totalNewStreamBytesSent: just sum(len)
EXPECT_EQ(conn->lossState.totalNewStreamBytesSent, 24); EXPECT_EQ(conn->lossState.totalNewStreamBytesSent, 24);
EXPECT_EQ( EXPECT_EQ(
@@ -730,6 +733,10 @@ TEST_F(
// total = 66 // total = 66
EXPECT_EQ(conn->lossState.totalStreamBytesSent, 66); // sum(len) EXPECT_EQ(conn->lossState.totalStreamBytesSent, 66); // sum(len)
EXPECT_EQ(stream1->newStreamBytesSent, 12);
EXPECT_EQ(stream2->newStreamBytesSent, 12);
EXPECT_EQ(stream3->newStreamBytesSent, 13);
// totalNewStreamBytesSent: just sum(len) // totalNewStreamBytesSent: just sum(len)
EXPECT_EQ(conn->lossState.totalNewStreamBytesSent, 37); EXPECT_EQ(conn->lossState.totalNewStreamBytesSent, 37);
EXPECT_EQ( EXPECT_EQ(

View File

@@ -315,6 +315,7 @@ struct QuicStreamState : public QuicStreamLike {
retransmissionBufMetas = std::move(other.retransmissionBufMetas); retransmissionBufMetas = std::move(other.retransmissionBufMetas);
lossBufMetas = std::move(other.lossBufMetas); lossBufMetas = std::move(other.lossBufMetas);
streamLossCount = other.streamLossCount; streamLossCount = other.streamLossCount;
newStreamBytesSent = other.newStreamBytesSent;
} }
// Connection that this stream is associated with. // Connection that this stream is associated with.
@@ -471,6 +472,10 @@ struct QuicStreamState : public QuicStreamLike {
uint64_t streamLossCount{0}; uint64_t streamLossCount{0};
// Total number of 'new' stream bytes sent on this stream.
// Does not include retransmissions of stream bytes.
uint64_t newStreamBytesSent{0};
/** /**
* Insert a new WriteBufferMeta into lossBufMetas. If the new WriteBufferMeta * Insert a new WriteBufferMeta into lossBufMetas. If the new WriteBufferMeta
* can be append to an existing WriteBufferMeta, it will be appended. Note * can be append to an existing WriteBufferMeta, it will be appended. Note