Implement missing candidate pair packets/bytes sent/received stats.
Specifically:
* packetsSent
* packetsReceived
* packetsDiscardedOnSend
* bytesDiscardedOnSend
Bug: webrtc:10569
Change-Id: Id92c20b93dea57637239a6321bd8aa644867f272
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232961
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35113}
diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc
index 1f8b28d..7637c07 100644
--- a/pc/rtc_stats_collector.cc
+++ b/pc/rtc_stats_collector.cc
@@ -1552,8 +1552,18 @@
// false after a certain amount of time without a response passes.
// https://crbug.com/633550
candidate_pair_stats->writable = info.writable;
+ // Note that sent_total_packets includes discarded packets but
+ // sent_total_bytes does not.
+ candidate_pair_stats->packets_sent = static_cast<uint64_t>(
+ info.sent_total_packets - info.sent_discarded_packets);
+ candidate_pair_stats->packets_discarded_on_send =
+ static_cast<uint64_t>(info.sent_discarded_packets);
+ candidate_pair_stats->packets_received =
+ static_cast<uint64_t>(info.packets_received);
candidate_pair_stats->bytes_sent =
static_cast<uint64_t>(info.sent_total_bytes);
+ candidate_pair_stats->bytes_discarded_on_send =
+ static_cast<uint64_t>(info.sent_discarded_bytes);
candidate_pair_stats->bytes_received =
static_cast<uint64_t>(info.recv_total_bytes);
candidate_pair_stats->total_round_trip_time =