Implement RTCOutboundRtpStreamStats.retransmitted[Bytes/Packets]Sent.

Spec: https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-retransmittedpacketssent

These are already existed in StreamDataCounters. This CL takes care of
the plumbing of these values to the standard stats collector.

TBR=solenberg@webrtc.org

Bug: webrtc:10447
Change-Id: I27d6c3ee3ab627d306303e6ee67e586ddf31cc81
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132012
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27663}
This commit is contained in:
Henrik Boström
2019-04-17 13:51:53 +02:00
committed by Commit Bot
parent decc07679d
commit cf96e0f87d
13 changed files with 72 additions and 11 deletions

View File

@ -389,7 +389,9 @@ webrtc::AudioSendStream::Stats AudioSendStream::GetStats(
webrtc::CallSendStatistics call_stats = channel_send_->GetRTCPStatistics();
stats.bytes_sent = call_stats.bytesSent;
stats.retransmitted_bytes_sent = call_stats.retransmitted_bytes_sent;
stats.packets_sent = call_stats.packetsSent;
stats.retransmitted_packets_sent = call_stats.retransmitted_packets_sent;
// RTT isn't known until a RTCP report is received. Until then, VoiceEngine
// returns 0 to indicate an error value.
if (call_stats.rttMs > 0) {

View File

@ -1070,17 +1070,22 @@ CallSendStatistics ChannelSend::GetRTCPStatistics() const {
CallSendStatistics stats = {0};
stats.rttMs = GetRTT();
size_t bytesSent(0);
uint32_t packetsSent(0);
if (_rtpRtcpModule->DataCountersRTP(&bytesSent, &packetsSent) != 0) {
RTC_DLOG(LS_WARNING)
<< "GetRTPStatistics() failed to retrieve RTP datacounters"
<< " => output will not be complete";
}
stats.bytesSent = bytesSent;
stats.packetsSent = packetsSent;
StreamDataCounters rtp_stats;
StreamDataCounters rtx_stats;
_rtpRtcpModule->GetSendStreamDataCounters(&rtp_stats, &rtx_stats);
// TODO(https://crbug.com/webrtc/10525): Bytes sent should only include
// payload bytes, not header and padding bytes.
stats.bytesSent =
rtp_stats.transmitted.payload_bytes +
rtp_stats.transmitted.padding_bytes + rtp_stats.transmitted.header_bytes +
rtx_stats.transmitted.payload_bytes +
rtx_stats.transmitted.padding_bytes + rtx_stats.transmitted.header_bytes;
// TODO(https://crbug.com/webrtc/10555): RTX retransmissions should show up in
// separate outbound-rtp stream objects.
stats.retransmitted_bytes_sent = rtp_stats.retransmitted.payload_bytes;
stats.packetsSent =
rtp_stats.transmitted.packets + rtx_stats.transmitted.packets;
stats.retransmitted_packets_sent = rtp_stats.retransmitted.packets;
return stats;
}

View File

@ -35,7 +35,11 @@ class RtpTransportControllerSendInterface;
struct CallSendStatistics {
int64_t rttMs;
size_t bytesSent;
// https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-retransmittedbytessent
uint64_t retransmitted_bytes_sent;
int packetsSent;
// https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-retransmittedpacketssent
uint64_t retransmitted_packets_sent;
};
// See section 6.4.2 in http://www.ietf.org/rfc/rfc3550.txt for details.