peerconnection: measure bundle policy usage
measured in the connectionstatechange event to connected which usually happens once per connection. BUG=webrtc:12383 Change-Id: Ida136c44bfe65e922627390747f8bee384603715 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/204301 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Justin Uberti <juberti@webrtc.org> Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com> Cr-Commit-Position: refs/heads/master@{#33207}
This commit is contained in:

committed by
Commit Bot

parent
6d17602e70
commit
bb8f32f541
@ -191,6 +191,17 @@ enum BundleUsage {
|
||||
kBundleUsageMax
|
||||
};
|
||||
|
||||
// Metrics for reporting configured BUNDLE policy, mapping directly to
|
||||
// https://w3c.github.io/webrtc-pc/#rtcbundlepolicy-enum
|
||||
// These values are persisted to logs. Entries should not be renumbered and
|
||||
// numeric values should never be reused.
|
||||
enum BundlePolicyUsage {
|
||||
kBundlePolicyUsageBalanced = 0,
|
||||
kBundlePolicyUsageMaxBundle = 1,
|
||||
kBundlePolicyUsageMaxCompat = 2,
|
||||
kBundlePolicyUsageMax
|
||||
};
|
||||
|
||||
// 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.
|
||||
|
@ -1738,6 +1738,27 @@ void PeerConnection::SetConnectionState(
|
||||
return;
|
||||
connection_state_ = new_state;
|
||||
Observer()->OnConnectionChange(new_state);
|
||||
|
||||
// The connection state change to connected usually happens once per
|
||||
// connection which makes it a good point to report metrics.
|
||||
if (new_state == PeerConnectionState::kConnected) {
|
||||
// Record bundle-policy from configuration. Done here from
|
||||
// connectionStateChange to limit to actually established connections.
|
||||
BundlePolicyUsage policy = kBundlePolicyUsageMax;
|
||||
switch (configuration_.bundle_policy) {
|
||||
case kBundlePolicyBalanced:
|
||||
policy = kBundlePolicyUsageBalanced;
|
||||
break;
|
||||
case kBundlePolicyMaxBundle:
|
||||
policy = kBundlePolicyUsageMaxBundle;
|
||||
break;
|
||||
case kBundlePolicyMaxCompat:
|
||||
policy = kBundlePolicyUsageMaxCompat;
|
||||
break;
|
||||
}
|
||||
RTC_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.BundlePolicy", policy,
|
||||
kBundlePolicyUsageMax);
|
||||
}
|
||||
}
|
||||
|
||||
void PeerConnection::OnIceGatheringChange(
|
||||
|
Reference in New Issue
Block a user