buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 1 | /* |
kjellander | b24317b | 2016-02-10 15:54:43 | [diff] [blame] | 2 | * Copyright 2014 The WebRTC project authors. All Rights Reserved. |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 3 | * |
kjellander | b24317b | 2016-02-10 15:54:43 | [diff] [blame] | 4 | * 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.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 9 | */ |
| 10 | |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 11 | // 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.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 14 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 15 | #ifndef API_UMA_METRICS_H_ |
| 16 | #define API_UMA_METRICS_H_ |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 17 | |
| 18 | namespace webrtc { |
| 19 | |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 20 | // These values are persisted to logs. Entries should not be renumbered and |
| 21 | // numeric values should never be reused. |
Guo-wei Shieh | 3d564c1 | 2015-08-19 23:51:15 | [diff] [blame] | 22 | enum PeerConnectionAddressFamilyCounter { |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 23 | kPeerConnection_IPv4 = 0, |
| 24 | kPeerConnection_IPv6 = 1, |
| 25 | kBestConnections_IPv4 = 2, |
| 26 | kBestConnections_IPv6 = 3, |
| 27 | kPeerConnectionAddressFamilyCounter_Max |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 28 | }; |
| 29 | |
| 30 | // This enum defines types for UMA samples, which will have a range. |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 31 | // These values are persisted to logs. Entries should not be renumbered and |
| 32 | // numeric values should never be reused. |
guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 | [diff] [blame] | 33 | enum PeerConnectionMetricsName { |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 34 | 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.org | 7169afd | 2014-12-04 17:59:29 | [diff] [blame] | 39 | kPeerConnectionMetricsName_Max |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 40 | }; |
| 41 | |
Guo-wei Shieh | 3d564c1 | 2015-08-19 23:51:15 | [diff] [blame] | 42 | // 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 Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 46 | // These values are persisted to logs. Entries should not be renumbered and |
| 47 | // numeric values should never be reused. |
Guo-wei Shieh | 3d564c1 | 2015-08-19 23:51:15 | [diff] [blame] | 48 | enum IceCandidatePairType { |
Guo-wei Shieh | 3cc834a | 2015-09-04 22:52:14 | [diff] [blame] | 49 | // HostHost is deprecated. It was replaced with the set of types at the bottom |
| 50 | // to report private or public host IP address. |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 51 | 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 Shieh | 3cc834a | 2015-09-04 22:52:14 | [diff] [blame] | 66 | |
Jeroen de Borst | 833979f | 2018-12-13 16:25:54 | [diff] [blame] | 67 | // The following 9 types tell whether local and remote hosts have hostname, |
| 68 | // private or public IP addresses. |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 69 | 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 Shieh | 3d564c1 | 2015-08-19 23:51:15 | [diff] [blame] | 78 | kIceCandidatePairMax |
| 79 | }; |
| 80 | |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 81 | // 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 Alvestrand | 194939b | 2018-01-24 15:04:13 | [diff] [blame] | 88 | enum KeyExchangeProtocolType { |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 89 | kEnumCounterKeyProtocolDtls = 0, |
| 90 | kEnumCounterKeyProtocolSdes = 1, |
Harald Alvestrand | 194939b | 2018-01-24 15:04:13 | [diff] [blame] | 91 | kEnumCounterKeyProtocolMax |
| 92 | }; |
| 93 | |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 94 | // These values are persisted to logs. Entries should not be renumbered and |
| 95 | // numeric values should never be reused. |
Harald Alvestrand | f9d0f1d | 2018-03-02 13:15:26 | [diff] [blame] | 96 | enum KeyExchangeProtocolMedia { |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 97 | kEnumCounterKeyProtocolMediaTypeDtlsAudio = 0, |
| 98 | kEnumCounterKeyProtocolMediaTypeDtlsVideo = 1, |
| 99 | kEnumCounterKeyProtocolMediaTypeDtlsData = 2, |
| 100 | kEnumCounterKeyProtocolMediaTypeSdesAudio = 3, |
| 101 | kEnumCounterKeyProtocolMediaTypeSdesVideo = 4, |
| 102 | kEnumCounterKeyProtocolMediaTypeSdesData = 5, |
Harald Alvestrand | f9d0f1d | 2018-03-02 13:15:26 | [diff] [blame] | 103 | kEnumCounterKeyProtocolMediaTypeMax |
| 104 | }; |
| 105 | |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 106 | // These values are persisted to logs. Entries should not be renumbered and |
| 107 | // numeric values should never be reused. |
Harald Alvestrand | 5dbb586 | 2018-02-13 22:48:00 | [diff] [blame] | 108 | enum SdpSemanticRequested { |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 109 | kSdpSemanticRequestDefault = 0, |
| 110 | kSdpSemanticRequestPlanB = 1, |
| 111 | kSdpSemanticRequestUnifiedPlan = 2, |
Harald Alvestrand | 5dbb586 | 2018-02-13 22:48:00 | [diff] [blame] | 112 | kSdpSemanticRequestMax |
| 113 | }; |
| 114 | |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 115 | // These values are persisted to logs. Entries should not be renumbered and |
| 116 | // numeric values should never be reused. |
Harald Alvestrand | 5dbb586 | 2018-02-13 22:48:00 | [diff] [blame] | 117 | enum SdpSemanticNegotiated { |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 118 | kSdpSemanticNegotiatedNone = 0, |
| 119 | kSdpSemanticNegotiatedPlanB = 1, |
| 120 | kSdpSemanticNegotiatedUnifiedPlan = 2, |
| 121 | kSdpSemanticNegotiatedMixed = 3, |
Harald Alvestrand | 5dbb586 | 2018-02-13 22:48:00 | [diff] [blame] | 122 | kSdpSemanticNegotiatedMax |
| 123 | }; |
| 124 | |
Steve Anton | 8e20f17 | 2018-03-06 18:55:04 | [diff] [blame] | 125 | // 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 Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 127 | // These values are persisted to logs. Entries should not be renumbered and |
| 128 | // numeric values should never be reused. |
Steve Anton | 8e20f17 | 2018-03-06 18:55:04 | [diff] [blame] | 129 | enum 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 Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 132 | kSdpFormatReceivedNoTracks = 0, |
Steve Anton | 8e20f17 | 2018-03-06 18:55:04 | [diff] [blame] | 133 | // No more than one audio and one video track. Should be compatible with both |
| 134 | // Plan B and Unified Plan endpoints. |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 135 | kSdpFormatReceivedSimple = 1, |
Steve Anton | 8e20f17 | 2018-03-06 18:55:04 | [diff] [blame] | 136 | // 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 Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 138 | kSdpFormatReceivedComplexPlanB = 2, |
Steve Anton | 8e20f17 | 2018-03-06 18:55:04 | [diff] [blame] | 139 | // More than one audio track or more than one video track in the Unified Plan |
| 140 | // format (e.g., two audio media sections). |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 141 | kSdpFormatReceivedComplexUnifiedPlan = 3, |
Steve Anton | 8e20f17 | 2018-03-06 18:55:04 | [diff] [blame] | 142 | kSdpFormatReceivedMax |
| 143 | }; |
| 144 | |
Harald Alvestrand | 76829d7 | 2018-07-18 21:24:36 | [diff] [blame] | 145 | // Metric for counting the outcome of adding an ICE candidate |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 146 | // These values are persisted to logs. Entries should not be renumbered and |
| 147 | // numeric values should never be reused. |
Harald Alvestrand | 76829d7 | 2018-07-18 21:24:36 | [diff] [blame] | 148 | enum AddIceCandidateResult { |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 149 | kAddIceCandidateSuccess = 0, |
| 150 | kAddIceCandidateFailClosed = 1, |
| 151 | kAddIceCandidateFailNoRemoteDescription = 2, |
| 152 | kAddIceCandidateFailNullCandidate = 3, |
| 153 | kAddIceCandidateFailNotValid = 4, |
| 154 | kAddIceCandidateFailNotReady = 5, |
| 155 | kAddIceCandidateFailInAddition = 6, |
| 156 | kAddIceCandidateFailNotUsable = 7, |
Harald Alvestrand | 76829d7 | 2018-07-18 21:24:36 | [diff] [blame] | 157 | kAddIceCandidateMax |
| 158 | }; |
| 159 | |
Amit Hilbuch | e2a284d | 2019-03-05 20:36:31 | [diff] [blame] | 160 | // Metric for recording which api surface was used to enable simulcast. |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 161 | // These values are persisted to logs. Entries should not be renumbered and |
| 162 | // numeric values should never be reused. |
Amit Hilbuch | e2a284d | 2019-03-05 20:36:31 | [diff] [blame] | 163 | enum SimulcastApiVersion { |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 164 | kSimulcastApiVersionNone = 0, |
| 165 | kSimulcastApiVersionLegacy = 1, |
| 166 | kSimulcastApiVersionSpecCompliant = 2, |
| 167 | kSimulcastApiVersionMax |
Amit Hilbuch | e2a284d | 2019-03-05 20:36:31 | [diff] [blame] | 168 | }; |
| 169 | |
Philipp Hancke | 54b925c | 2021-01-28 08:56:39 | [diff] [blame] | 170 | // 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. |
| 173 | enum 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 Hancke | bb8f32f | 2021-02-04 20:50:50 | [diff] [blame] | 194 | // 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. |
| 198 | enum BundlePolicyUsage { |
| 199 | kBundlePolicyUsageBalanced = 0, |
| 200 | kBundlePolicyUsageMaxBundle = 1, |
| 201 | kBundlePolicyUsageMaxCompat = 2, |
| 202 | kBundlePolicyUsageMax |
| 203 | }; |
| 204 | |
Philipp Hancke | 1b4807f | 2021-06-11 09:49:54 | [diff] [blame] | 205 | // 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. |
| 209 | enum ProvisionalAnswerUsage { |
| 210 | kProvisionalAnswerNotUsed = 0, |
| 211 | kProvisionalAnswerLocal = 1, |
| 212 | kProvisionalAnswerRemote = 2, |
| 213 | kProvisionalAnswerMax |
| 214 | }; |
| 215 | |
Philipp Hancke | d0948be | 2020-10-27 17:25:05 | [diff] [blame] | 216 | // 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.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 220 | } // namespace webrtc |
| 221 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 222 | #endif // API_UMA_METRICS_H_ |