webrtc-stats
webrtc-stats copied to clipboard
RTCOutboundRtpStreamStats.headerBytesSent/totalPacketSendDelay and RTX seems underspecified
Spec explicitly says that we should be totaling up packetsSent, bytesSent, retransmittedPacketsSent, and retransmittedBytesSent. But what about headerBytesSent/totalPacketSendDelay?
It seems pretty clear that this should include RTX, since spec says "headerBytesSent + bytesSent equals the number of bytes sent as payload over the transport.", and bytesSent accounts for RTX.
This probably ought to account for RTX as well. The only way I can see this metric being useful is by comparing it to packetsSent (over some time window), and packetsSent includes RTX packets.
retransmittedPacketsSent and retransmittedBytesSent are already included in packetsSent and bytesSent. So they should be include retransmissions. Unless I am missing something, the definitions are correct, however, based on the ticket, a clarification would help the implementor. Would the following improvements clarify the definitions:
headerBytesSent of type unsigned long long
Total number of RTP header and padding bytes sent for this SSRC. This does not include the size of transport layer headers such as IP or UDP. headerBytesSent includes retransmissions. Hence, headerBytesSent + bytesSent equals the number of bytes sent as payload over the transport.
For totalPacketSendDelay says the measurement is added each time the packetSent is incremented. And the packetSent explicitly states that it includes retransmissions. Would the following clarification help?
totalPacketSendDelay of type double
The total number of seconds that packets have spent buffered locally before being transmitted onto the network. The time is measured from when a packet is emitted from the RTP packetizer until it is handed over to the OS network socket. This measurement is added to totalPacketSendDelay when packetsSent is incremented. packetSent includes retransmitted packets, therefore, this measurement should be include send delays for retransmitted packets.
Yeah, I think being explicit here is necessary.
Will you provide a clarification PR @vr000m ? (I think we can merge such PRs even if #746 has yet to be resolved)
How is this kind of stuff testable?
I've checked what libWebRTC does as part of implementing RTX stats.
It does not include the payload of RTX packets, so the accurate thing to say would be:
headerBytesSent includes the header bytes of retransmissions
Agree that the clarification is appropriate. Header bytes of retransmissions.
Can you confirm if the retransmission bytes are added to bytesSent?