blob: 9eb3bf7e1fa35054460b171775566643cd348f35 [file] [log] [blame]
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +00001/*
kjellanderb24317b2016-02-10 07:54:43 -08002 * Copyright 2014 The WebRTC project authors. All Rights Reserved.
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +00003 *
kjellanderb24317b2016-02-10 07:54:43 -08004 * 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:16 +00009 */
10
Philipp Hancked0948be2020-10-27 18:25:05 +010011// 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:16 +000014
Steve Anton10542f22019-01-11 09:11:00 -080015#ifndef API_UMA_METRICS_H_
16#define API_UMA_METRICS_H_
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000017
18namespace webrtc {
19
Philipp Hancked0948be2020-10-27 18:25:05 +010020// These values are persisted to logs. Entries should not be renumbered and
21// numeric values should never be reused.
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070022enum PeerConnectionAddressFamilyCounter {
Philipp Hancked0948be2020-10-27 18:25:05 +010023 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:16 +000028};
29
30// This enum defines types for UMA samples, which will have a range.
Philipp Hancked0948be2020-10-27 18:25:05 +010031// 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:29 +000033enum PeerConnectionMetricsName {
Philipp Hancked0948be2020-10-27 18:25:05 +010034 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:29 +000039 kPeerConnectionMetricsName_Max
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000040};
41
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070042// 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 18:25:05 +010046// These values are persisted to logs. Entries should not be renumbered and
47// numeric values should never be reused.
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070048enum IceCandidatePairType {
Guo-wei Shieh3cc834a2015-09-04 15:52:14 -070049 // 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 18:25:05 +010051 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 15:52:14 -070066
Jeroen de Borst833979f2018-12-13 08:25:54 -080067 // The following 9 types tell whether local and remote hosts have hostname,
68 // private or public IP addresses.
Philipp Hancked0948be2020-10-27 18:25:05 +010069 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 16:51:15 -070078 kIceCandidatePairMax
79};
80
Philipp Hancked0948be2020-10-27 18:25:05 +010081// 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 Alvestrandf9d0f1d2018-03-02 14:15:26 +010088enum KeyExchangeProtocolMedia {
Philipp Hancked0948be2020-10-27 18:25:05 +010089 kEnumCounterKeyProtocolMediaTypeDtlsAudio = 0,
90 kEnumCounterKeyProtocolMediaTypeDtlsVideo = 1,
91 kEnumCounterKeyProtocolMediaTypeDtlsData = 2,
92 kEnumCounterKeyProtocolMediaTypeSdesAudio = 3,
93 kEnumCounterKeyProtocolMediaTypeSdesVideo = 4,
94 kEnumCounterKeyProtocolMediaTypeSdesData = 5,
Harald Alvestrandf9d0f1d2018-03-02 14:15:26 +010095 kEnumCounterKeyProtocolMediaTypeMax
96};
97
Philipp Hancked0948be2020-10-27 18:25:05 +010098// These values are persisted to logs. Entries should not be renumbered and
99// numeric values should never be reused.
Harald Alvestrand5dbb5862018-02-13 23:48:00 +0100100enum SdpSemanticRequested {
Philipp Hancked0948be2020-10-27 18:25:05 +0100101 kSdpSemanticRequestDefault = 0,
102 kSdpSemanticRequestPlanB = 1,
103 kSdpSemanticRequestUnifiedPlan = 2,
Harald Alvestrand5dbb5862018-02-13 23:48:00 +0100104 kSdpSemanticRequestMax
105};
106
Harald Alvestrand76829d72018-07-18 23:24:36 +0200107// Metric for counting the outcome of adding an ICE candidate
Philipp Hancked0948be2020-10-27 18:25:05 +0100108// These values are persisted to logs. Entries should not be renumbered and
109// numeric values should never be reused.
Harald Alvestrand76829d72018-07-18 23:24:36 +0200110enum AddIceCandidateResult {
Philipp Hancked0948be2020-10-27 18:25:05 +0100111 kAddIceCandidateSuccess = 0,
112 kAddIceCandidateFailClosed = 1,
113 kAddIceCandidateFailNoRemoteDescription = 2,
114 kAddIceCandidateFailNullCandidate = 3,
115 kAddIceCandidateFailNotValid = 4,
116 kAddIceCandidateFailNotReady = 5,
117 kAddIceCandidateFailInAddition = 6,
118 kAddIceCandidateFailNotUsable = 7,
Harald Alvestrand76829d72018-07-18 23:24:36 +0200119 kAddIceCandidateMax
120};
121
Amit Hilbuche2a284d2019-03-05 12:36:31 -0800122// Metric for recording which api surface was used to enable simulcast.
Philipp Hancked0948be2020-10-27 18:25:05 +0100123// These values are persisted to logs. Entries should not be renumbered and
124// numeric values should never be reused.
Amit Hilbuche2a284d2019-03-05 12:36:31 -0800125enum SimulcastApiVersion {
Philipp Hancked0948be2020-10-27 18:25:05 +0100126 kSimulcastApiVersionNone = 0,
127 kSimulcastApiVersionLegacy = 1,
128 kSimulcastApiVersionSpecCompliant = 2,
129 kSimulcastApiVersionMax
Amit Hilbuche2a284d2019-03-05 12:36:31 -0800130};
131
Philipp Hancke54b925c2021-01-28 09:56:39 +0100132// Metrics for reporting usage of BUNDLE.
133// These values are persisted to logs. Entries should not be renumbered and
134// numeric values should never be reused.
135enum BundleUsage {
136 // There are no m-lines in the SDP, only a session description.
137 kBundleUsageEmpty = 0,
138 // Only a data channel is negotiated but BUNDLE is not negotiated.
139 kBundleUsageNoBundleDatachannelOnly = 1,
140 // BUNDLE is not negotiated and there is at most one m-line per media type,
141 kBundleUsageNoBundleSimple = 2,
142 // BUNDLE is not negotiated and there are multiple m-lines per media type,
143 kBundleUsageNoBundleComplex = 3,
144 // Only a data channel is negotiated and BUNDLE is negotiated.
145 kBundleUsageBundleDatachannelOnly = 4,
146 // BUNDLE is negotiated but there is at most one m-line per media type,
147 kBundleUsageBundleSimple = 5,
148 // BUNDLE is negotiated and there are multiple m-lines per media type,
149 kBundleUsageBundleComplex = 6,
150 // Legacy plan-b metrics.
151 kBundleUsageNoBundlePlanB = 7,
152 kBundleUsageBundlePlanB = 8,
153 kBundleUsageMax
154};
155
Philipp Hanckebb8f32f2021-02-04 21:50:50 +0100156// Metrics for reporting configured BUNDLE policy, mapping directly to
157// https://w3c.github.io/webrtc-pc/#rtcbundlepolicy-enum
158// These values are persisted to logs. Entries should not be renumbered and
159// numeric values should never be reused.
160enum BundlePolicyUsage {
161 kBundlePolicyUsageBalanced = 0,
162 kBundlePolicyUsageMaxBundle = 1,
163 kBundlePolicyUsageMaxCompat = 2,
164 kBundlePolicyUsageMax
165};
166
Philipp Hancke1b4807f2021-06-11 11:49:54 +0200167// Metrics for provisional answers as described in
168// https://datatracker.ietf.org/doc/html/rfc8829#section-4.1.10.1
169// These values are persisted to logs. Entries should not be renumbered and
170// numeric values should never be reused.
171enum ProvisionalAnswerUsage {
172 kProvisionalAnswerNotUsed = 0,
173 kProvisionalAnswerLocal = 1,
174 kProvisionalAnswerRemote = 2,
175 kProvisionalAnswerMax
176};
177
Philipp Hancked0948be2020-10-27 18:25:05 +0100178// When adding new metrics please consider using the style described in
179// https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md#usage
180// instead of the legacy enums used above.
181
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +0000182} // namespace webrtc
183
Steve Anton10542f22019-01-11 09:11:00 -0800184#endif // API_UMA_METRICS_H_