blob: a975b82aeb89c56e2bfb88ccb38d657df0f8e5c7 [file] [log] [blame]
buildbot@webrtc.org1567b8c2014-05-08 19:54:161/*
kjellanderb24317b2016-02-10 15:54:432 * Copyright 2014 The WebRTC project authors. All Rights Reserved.
buildbot@webrtc.org1567b8c2014-05-08 19:54:163 *
kjellanderb24317b2016-02-10 15:54:434 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
buildbot@webrtc.org1567b8c2014-05-08 19:54:169 */
10
Philipp Hancked0948be2020-10-27 17:25:0511// This file contains enums related to Chrome UMA histograms. See
12// https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md#requirements
13// for requirements when adding or changing metrics.
buildbot@webrtc.org1567b8c2014-05-08 19:54:1614
Steve Anton10542f22019-01-11 17:11:0015#ifndef API_UMA_METRICS_H_
16#define API_UMA_METRICS_H_
buildbot@webrtc.org1567b8c2014-05-08 19:54:1617
18namespace webrtc {
19
Philipp Hancked0948be2020-10-27 17:25:0520// These values are persisted to logs. Entries should not be renumbered and
21// numeric values should never be reused.
Guo-wei Shieh3d564c12015-08-19 23:51:1522enum PeerConnectionAddressFamilyCounter {
Philipp Hancked0948be2020-10-27 17:25:0523 kPeerConnection_IPv4 = 0,
24 kPeerConnection_IPv6 = 1,
25 kBestConnections_IPv4 = 2,
26 kBestConnections_IPv6 = 3,
27 kPeerConnectionAddressFamilyCounter_Max
buildbot@webrtc.org1567b8c2014-05-08 19:54:1628};
29
30// This enum defines types for UMA samples, which will have a range.
Philipp Hancked0948be2020-10-27 17:25:0531// These values are persisted to logs. Entries should not be renumbered and
32// numeric values should never be reused.
guoweis@webrtc.org7169afd2014-12-04 17:59:2933enum PeerConnectionMetricsName {
Philipp Hancked0948be2020-10-27 17:25:0534 kNetworkInterfaces_IPv4 = 0, // Number of IPv4 interfaces.
35 kNetworkInterfaces_IPv6 = 1, // Number of IPv6 interfaces.
36 kTimeToConnect = 2, // In milliseconds.
37 kLocalCandidates_IPv4 = 3, // Number of IPv4 local candidates.
38 kLocalCandidates_IPv6 = 4, // Number of IPv6 local candidates.
guoweis@webrtc.org7169afd2014-12-04 17:59:2939 kPeerConnectionMetricsName_Max
buildbot@webrtc.org1567b8c2014-05-08 19:54:1640};
41
Guo-wei Shieh3d564c12015-08-19 23:51:1542// The IceCandidatePairType has the format of
43// <local_candidate_type>_<remote_candidate_type>. It is recorded based on the
44// type of candidate pair used when the PeerConnection first goes to a completed
45// state. When BUNDLE is enabled, only the first transport gets recorded.
Philipp Hancked0948be2020-10-27 17:25:0546// These values are persisted to logs. Entries should not be renumbered and
47// numeric values should never be reused.
Guo-wei Shieh3d564c12015-08-19 23:51:1548enum IceCandidatePairType {
Guo-wei Shieh3cc834a2015-09-04 22:52:1449 // HostHost is deprecated. It was replaced with the set of types at the bottom
50 // to report private or public host IP address.
Philipp Hancked0948be2020-10-27 17:25:0551 kIceCandidatePairHostHost = 0,
52 kIceCandidatePairHostSrflx = 1,
53 kIceCandidatePairHostRelay = 2,
54 kIceCandidatePairHostPrflx = 3,
55 kIceCandidatePairSrflxHost = 4,
56 kIceCandidatePairSrflxSrflx = 5,
57 kIceCandidatePairSrflxRelay = 6,
58 kIceCandidatePairSrflxPrflx = 7,
59 kIceCandidatePairRelayHost = 8,
60 kIceCandidatePairRelaySrflx = 9,
61 kIceCandidatePairRelayRelay = 10,
62 kIceCandidatePairRelayPrflx = 11,
63 kIceCandidatePairPrflxHost = 12,
64 kIceCandidatePairPrflxSrflx = 13,
65 kIceCandidatePairPrflxRelay = 14,
Guo-wei Shieh3cc834a2015-09-04 22:52:1466
Jeroen de Borst833979f2018-12-13 16:25:5467 // The following 9 types tell whether local and remote hosts have hostname,
68 // private or public IP addresses.
Philipp Hancked0948be2020-10-27 17:25:0569 kIceCandidatePairHostPrivateHostPrivate = 15,
70 kIceCandidatePairHostPrivateHostPublic = 16,
71 kIceCandidatePairHostPublicHostPrivate = 17,
72 kIceCandidatePairHostPublicHostPublic = 18,
73 kIceCandidatePairHostNameHostName = 19,
74 kIceCandidatePairHostNameHostPrivate = 20,
75 kIceCandidatePairHostNameHostPublic = 21,
76 kIceCandidatePairHostPrivateHostName = 22,
77 kIceCandidatePairHostPublicHostName = 23,
Guo-wei Shieh3d564c12015-08-19 23:51:1578 kIceCandidatePairMax
79};
80
Philipp Hancked0948be2020-10-27 17:25:0581// The difference between PeerConnectionEnumCounter and
82// PeerConnectionMetricsName is that the "EnumCounter" is only counting the
83// occurrences of events, while "Name" has a value associated with it which is
84// used to form a histogram.
85
86// These values are persisted to logs. Entries should not be renumbered and
87// numeric values should never be reused.
Harald Alvestrand194939b2018-01-24 15:04:1388enum KeyExchangeProtocolType {
Philipp Hancked0948be2020-10-27 17:25:0589 kEnumCounterKeyProtocolDtls = 0,
90 kEnumCounterKeyProtocolSdes = 1,
Harald Alvestrand194939b2018-01-24 15:04:1391 kEnumCounterKeyProtocolMax
92};
93
Philipp Hancked0948be2020-10-27 17:25:0594// These values are persisted to logs. Entries should not be renumbered and
95// numeric values should never be reused.
Harald Alvestrandf9d0f1d2018-03-02 13:15:2696enum KeyExchangeProtocolMedia {
Philipp Hancked0948be2020-10-27 17:25:0597 kEnumCounterKeyProtocolMediaTypeDtlsAudio = 0,
98 kEnumCounterKeyProtocolMediaTypeDtlsVideo = 1,
99 kEnumCounterKeyProtocolMediaTypeDtlsData = 2,
100 kEnumCounterKeyProtocolMediaTypeSdesAudio = 3,
101 kEnumCounterKeyProtocolMediaTypeSdesVideo = 4,
102 kEnumCounterKeyProtocolMediaTypeSdesData = 5,
Harald Alvestrandf9d0f1d2018-03-02 13:15:26103 kEnumCounterKeyProtocolMediaTypeMax
104};
105
Philipp Hancked0948be2020-10-27 17:25:05106// These values are persisted to logs. Entries should not be renumbered and
107// numeric values should never be reused.
Harald Alvestrand5dbb5862018-02-13 22:48:00108enum SdpSemanticRequested {
Philipp Hancked0948be2020-10-27 17:25:05109 kSdpSemanticRequestDefault = 0,
110 kSdpSemanticRequestPlanB = 1,
111 kSdpSemanticRequestUnifiedPlan = 2,
Harald Alvestrand5dbb5862018-02-13 22:48:00112 kSdpSemanticRequestMax
113};
114
Philipp Hancked0948be2020-10-27 17:25:05115// These values are persisted to logs. Entries should not be renumbered and
116// numeric values should never be reused.
Harald Alvestrand5dbb5862018-02-13 22:48:00117enum SdpSemanticNegotiated {
Philipp Hancked0948be2020-10-27 17:25:05118 kSdpSemanticNegotiatedNone = 0,
119 kSdpSemanticNegotiatedPlanB = 1,
120 kSdpSemanticNegotiatedUnifiedPlan = 2,
121 kSdpSemanticNegotiatedMixed = 3,
Harald Alvestrand5dbb5862018-02-13 22:48:00122 kSdpSemanticNegotiatedMax
123};
124
Steve Anton8e20f172018-03-06 18:55:04125// Metric which records the format of the received SDP for tracking how much the
126// difference between Plan B and Unified Plan affect users.
Philipp Hancked0948be2020-10-27 17:25:05127// These values are persisted to logs. Entries should not be renumbered and
128// numeric values should never be reused.
Steve Anton8e20f172018-03-06 18:55:04129enum SdpFormatReceived {
130 // No audio or video tracks. This is worth special casing since it seems to be
131 // the most common scenario (data-channel only).
Philipp Hancked0948be2020-10-27 17:25:05132 kSdpFormatReceivedNoTracks = 0,
Steve Anton8e20f172018-03-06 18:55:04133 // No more than one audio and one video track. Should be compatible with both
134 // Plan B and Unified Plan endpoints.
Philipp Hancked0948be2020-10-27 17:25:05135 kSdpFormatReceivedSimple = 1,
Steve Anton8e20f172018-03-06 18:55:04136 // More than one audio track or more than one video track in the Plan B format
137 // (e.g., one audio media section with multiple streams).
Philipp Hancked0948be2020-10-27 17:25:05138 kSdpFormatReceivedComplexPlanB = 2,
Steve Anton8e20f172018-03-06 18:55:04139 // More than one audio track or more than one video track in the Unified Plan
140 // format (e.g., two audio media sections).
Philipp Hancked0948be2020-10-27 17:25:05141 kSdpFormatReceivedComplexUnifiedPlan = 3,
Steve Anton8e20f172018-03-06 18:55:04142 kSdpFormatReceivedMax
143};
144
Harald Alvestrand76829d72018-07-18 21:24:36145// Metric for counting the outcome of adding an ICE candidate
Philipp Hancked0948be2020-10-27 17:25:05146// These values are persisted to logs. Entries should not be renumbered and
147// numeric values should never be reused.
Harald Alvestrand76829d72018-07-18 21:24:36148enum AddIceCandidateResult {
Philipp Hancked0948be2020-10-27 17:25:05149 kAddIceCandidateSuccess = 0,
150 kAddIceCandidateFailClosed = 1,
151 kAddIceCandidateFailNoRemoteDescription = 2,
152 kAddIceCandidateFailNullCandidate = 3,
153 kAddIceCandidateFailNotValid = 4,
154 kAddIceCandidateFailNotReady = 5,
155 kAddIceCandidateFailInAddition = 6,
156 kAddIceCandidateFailNotUsable = 7,
Harald Alvestrand76829d72018-07-18 21:24:36157 kAddIceCandidateMax
158};
159
Amit Hilbuche2a284d2019-03-05 20:36:31160// Metric for recording which api surface was used to enable simulcast.
Philipp Hancked0948be2020-10-27 17:25:05161// These values are persisted to logs. Entries should not be renumbered and
162// numeric values should never be reused.
Amit Hilbuche2a284d2019-03-05 20:36:31163enum SimulcastApiVersion {
Philipp Hancked0948be2020-10-27 17:25:05164 kSimulcastApiVersionNone = 0,
165 kSimulcastApiVersionLegacy = 1,
166 kSimulcastApiVersionSpecCompliant = 2,
167 kSimulcastApiVersionMax
Amit Hilbuche2a284d2019-03-05 20:36:31168};
169
Philipp Hancke54b925c2021-01-28 08:56:39170// Metrics for reporting usage of BUNDLE.
171// These values are persisted to logs. Entries should not be renumbered and
172// numeric values should never be reused.
173enum BundleUsage {
174 // There are no m-lines in the SDP, only a session description.
175 kBundleUsageEmpty = 0,
176 // Only a data channel is negotiated but BUNDLE is not negotiated.
177 kBundleUsageNoBundleDatachannelOnly = 1,
178 // BUNDLE is not negotiated and there is at most one m-line per media type,
179 kBundleUsageNoBundleSimple = 2,
180 // BUNDLE is not negotiated and there are multiple m-lines per media type,
181 kBundleUsageNoBundleComplex = 3,
182 // Only a data channel is negotiated and BUNDLE is negotiated.
183 kBundleUsageBundleDatachannelOnly = 4,
184 // BUNDLE is negotiated but there is at most one m-line per media type,
185 kBundleUsageBundleSimple = 5,
186 // BUNDLE is negotiated and there are multiple m-lines per media type,
187 kBundleUsageBundleComplex = 6,
188 // Legacy plan-b metrics.
189 kBundleUsageNoBundlePlanB = 7,
190 kBundleUsageBundlePlanB = 8,
191 kBundleUsageMax
192};
193
Philipp Hanckebb8f32f2021-02-04 20:50:50194// Metrics for reporting configured BUNDLE policy, mapping directly to
195// https://w3c.github.io/webrtc-pc/#rtcbundlepolicy-enum
196// These values are persisted to logs. Entries should not be renumbered and
197// numeric values should never be reused.
198enum BundlePolicyUsage {
199 kBundlePolicyUsageBalanced = 0,
200 kBundlePolicyUsageMaxBundle = 1,
201 kBundlePolicyUsageMaxCompat = 2,
202 kBundlePolicyUsageMax
203};
204
Philipp Hancke1b4807f2021-06-11 09:49:54205// Metrics for provisional answers as described in
206// https://datatracker.ietf.org/doc/html/rfc8829#section-4.1.10.1
207// These values are persisted to logs. Entries should not be renumbered and
208// numeric values should never be reused.
209enum ProvisionalAnswerUsage {
210 kProvisionalAnswerNotUsed = 0,
211 kProvisionalAnswerLocal = 1,
212 kProvisionalAnswerRemote = 2,
213 kProvisionalAnswerMax
214};
215
Philipp Hancked0948be2020-10-27 17:25:05216// When adding new metrics please consider using the style described in
217// https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md#usage
218// instead of the legacy enums used above.
219
buildbot@webrtc.org1567b8c2014-05-08 19:54:16220} // namespace webrtc
221
Steve Anton10542f22019-01-11 17:11:00222#endif // API_UMA_METRICS_H_