mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-11-07 22:46:22 +03:00
Count cumulative # of egress packets for a stream
Summary: There are situations where application needs to know how many packets were transmitted for a stream on certain byte range. This diff provides *some* level of that information, by adding the `cumulativeTxedPackets` field in `StreamLike`, which stores the number of egress packets that contain new STREAM frame(s) for a stream. ~~To prevent double-counting, I added a fast set of stream ids.~~ Application could rely on other callbacks (e.g. ByteEventCallback or DeliveryCallback) to get notified, and use `getStreamTransportInfo` to get `packetsTxed` for a stream. Reviewed By: bschlinker, mjoras Differential Revision: D23361789 fbshipit-source-id: 6624ddcbe9cf62c628f936eda2a39d0fc2781636
This commit is contained in:
committed by
Facebook GitHub Bot
parent
820f102401
commit
3fac7d21f4
@@ -2867,8 +2867,11 @@ QuicTransportBase::getStreamTransportInfo(StreamId id) const {
|
||||
return folly::makeUnexpected(LocalErrorCode::STREAM_NOT_EXISTS);
|
||||
}
|
||||
auto stream = conn_->streamManager->getStream(id);
|
||||
return StreamTransportInfo{
|
||||
stream->totalHolbTime, stream->holbCount, bool(stream->lastHolbTime)};
|
||||
auto packets = getNumPacketsTxWithNewData(*stream);
|
||||
return StreamTransportInfo{stream->totalHolbTime,
|
||||
stream->holbCount,
|
||||
bool(stream->lastHolbTime),
|
||||
packets};
|
||||
}
|
||||
|
||||
void QuicTransportBase::describe(std::ostream& os) const {
|
||||
|
||||
Reference in New Issue
Block a user