Add support for RTCTransportStats.selectedCandidatePairChanges

This patch adds accounting and reporting needed for
newly added RTCTransportStats.selectedCandidatePairChanges,
https://w3c.github.io/webrtc-stats/#dom-rtctransportstats-selectedcandidatepairchanges

a) P2PTransportChannel counts everytime selected_connection_
is modified and reports this counter in the GetStats()-call.
b) RTCStatsCollector puts the counter into the standardized
stats object.

Bug: webrtc:10900
Change-Id: Ibaeca18706b8edcbcb44b0c6f2754854bcb545ba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149830
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28987}
This commit is contained in:
Jonas Oreland
2019-08-28 08:10:27 +02:00
committed by Commit Bot
parent 3b69817e62
commit 149dc72dfa
16 changed files with 211 additions and 88 deletions

View File

@ -868,7 +868,8 @@ WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport",
&dtls_state,
&selected_candidate_pair_id,
&local_certificate_id,
&remote_certificate_id)
&remote_certificate_id,
&selected_candidate_pair_changes)
// clang-format on
RTCTransportStats::RTCTransportStats(const std::string& id,
@ -883,7 +884,8 @@ RTCTransportStats::RTCTransportStats(std::string&& id, int64_t timestamp_us)
dtls_state("dtlsState"),
selected_candidate_pair_id("selectedCandidatePairId"),
local_certificate_id("localCertificateId"),
remote_certificate_id("remoteCertificateId") {}
remote_certificate_id("remoteCertificateId"),
selected_candidate_pair_changes("selectedCandidatePairChanges") {}
RTCTransportStats::RTCTransportStats(const RTCTransportStats& other)
: RTCStats(other.id(), other.timestamp_us()),
@ -893,7 +895,8 @@ RTCTransportStats::RTCTransportStats(const RTCTransportStats& other)
dtls_state(other.dtls_state),
selected_candidate_pair_id(other.selected_candidate_pair_id),
local_certificate_id(other.local_certificate_id),
remote_certificate_id(other.remote_certificate_id) {}
remote_certificate_id(other.remote_certificate_id),
selected_candidate_pair_changes(other.selected_candidate_pair_changes) {}
RTCTransportStats::~RTCTransportStats() {}