RTCIceCandidatePairStats.requestsSent should be total pings.

The spec says: "Represents the total number of connectivity check
requests sent (not including retransmissions)."

I was surprised to find candidate-pair.requestsSent wired up to
`sent_ping_requests_before_first_response`, which is the subset of
`sent_ping_requests_total` that happened when `recv_ping_responses`
was 0. This is not what the spec says.

By wiring it up to `sent_ping_requests_total` instead, the modern
getStats implementation of "requestsSent" will match the legacy
getStats implementation which is already wired up to this value.

// Unrelated bot issues
NOTRY=True

Bug: webrtc:14425
Change-Id: Ia53c9711ee7a13e596ae0eacf6066b97d9a1face
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274174
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38025}
This commit is contained in:
Henrik Boström 2022-09-06 11:16:36 +02:00 committed by WebRTC LUCI CQ
parent 808b951ab9
commit 839439ae84
2 changed files with 5 additions and 5 deletions

View File

@ -1758,8 +1758,8 @@ void RTCStatsCollector::ProduceIceCandidateAndPairStats_n(
}
candidate_pair_stats->requests_received =
static_cast<uint64_t>(info.recv_ping_requests);
candidate_pair_stats->requests_sent = static_cast<uint64_t>(
info.sent_ping_requests_before_first_response);
candidate_pair_stats->requests_sent =
static_cast<uint64_t>(info.sent_ping_requests_total);
candidate_pair_stats->responses_received =
static_cast<uint64_t>(info.recv_ping_responses);
candidate_pair_stats->responses_sent =

View File

@ -1628,7 +1628,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCIceCandidatePairStats) {
connection_info.total_round_trip_time_ms = 0;
connection_info.current_round_trip_time_ms = absl::nullopt;
connection_info.recv_ping_requests = 2020;
connection_info.sent_ping_requests_total = 2020;
connection_info.sent_ping_requests_total = 2222;
connection_info.sent_ping_requests_before_first_response = 2000;
connection_info.recv_ping_responses = 4321;
connection_info.sent_ping_responses = 1000;
@ -1665,10 +1665,10 @@ TEST_F(RTCStatsCollectorTest, CollectRTCIceCandidatePairStats) {
expected_pair.bytes_discarded_on_send = 7;
expected_pair.total_round_trip_time = 0.0;
expected_pair.requests_received = 2020;
expected_pair.requests_sent = 2000;
expected_pair.requests_sent = 2222;
expected_pair.responses_received = 4321;
expected_pair.responses_sent = 1000;
expected_pair.consent_requests_sent = (2020 - 2000);
expected_pair.consent_requests_sent = (2222 - 2000);
// `expected_pair.current_round_trip_time` should be undefined because the
// current RTT is not set.
// `expected_pair.available_[outgoing/incoming]_bitrate` should be undefined