diff --git a/api/uma_metrics.h b/api/uma_metrics.h index 9eb3bf7e1f..a63159e849 100644 --- a/api/uma_metrics.h +++ b/api/uma_metrics.h @@ -175,6 +175,16 @@ enum ProvisionalAnswerUsage { kProvisionalAnswerMax }; +// Metrics for RTCRtpMuxPolicy. The only defined value is +// https://w3c.github.io/webrtc-pc/#rtcrtcpmuxpolicy-enum +// "require" but there is a legacy option "negotiate" which +// was removed from the spec. +enum RtcpMuxPolicyUsage { + kRtcpMuxPolicyUsageRequire = 0, + kRtcpMuxPolicyUsageNegotiate = 1, + kRtcpMuxPolicyUsageMax +}; + // When adding new metrics please consider using the style described in // https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md#usage // instead of the legacy enums used above. diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc index 2e7434083a..f318acf4ff 100644 --- a/pc/peer_connection.cc +++ b/pc/peer_connection.cc @@ -2028,6 +2028,19 @@ void PeerConnection::ReportFirstConnectUsageMetrics() { "WebRTC.PeerConnection.ValidIceChars", !(isUsingInvalidIceCharInUfrag || isUsingInvalidIceCharInPwd)); } + + // Record RtcpMuxPolicy setting. + RtcpMuxPolicyUsage rtcp_mux_policy = kRtcpMuxPolicyUsageMax; + switch (configuration_.rtcp_mux_policy) { + case kRtcpMuxPolicyNegotiate: + rtcp_mux_policy = kRtcpMuxPolicyUsageNegotiate; + break; + case kRtcpMuxPolicyRequire: + rtcp_mux_policy = kRtcpMuxPolicyUsageRequire; + break; + } + RTC_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.RtcpMuxPolicy", + rtcp_mux_policy, kRtcpMuxPolicyUsageMax); } void PeerConnection::OnIceGatheringChange(