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 | |
| 11 | // This file contains enums related to IPv4/IPv6 metrics. |
| 12 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 13 | #ifndef API_UMA_METRICS_H_ |
| 14 | #define API_UMA_METRICS_H_ |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 15 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 16 | #include "rtc_base/ref_count.h" |
skvlad | 1d3c7e0 | 2017-01-12 01:50:30 | [diff] [blame] | 17 | |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 18 | namespace webrtc { |
| 19 | |
| 20 | // Currently this contains information related to WebRTC network/transport |
| 21 | // information. |
| 22 | |
Guo-wei Shieh | 3d564c1 | 2015-08-19 23:51:15 | [diff] [blame] | 23 | // The difference between PeerConnectionEnumCounter and |
| 24 | // PeerConnectionMetricsName is that the "EnumCounter" is only counting the |
guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 | [diff] [blame] | 25 | // occurrences of events, while "Name" has a value associated with it which is |
| 26 | // used to form a histogram. |
| 27 | |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 28 | // This enum is backed by Chromium's histograms.xml, |
| 29 | // chromium/src/tools/metrics/histograms/histograms.xml |
| 30 | // Existing values cannot be re-ordered and new enums must be added |
| 31 | // before kBoundary. |
Guo-wei Shieh | 3d564c1 | 2015-08-19 23:51:15 | [diff] [blame] | 32 | enum PeerConnectionAddressFamilyCounter { |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 33 | kPeerConnection_IPv4, |
| 34 | kPeerConnection_IPv6, |
| 35 | kBestConnections_IPv4, |
| 36 | kBestConnections_IPv6, |
Guo-wei Shieh | 3d564c1 | 2015-08-19 23:51:15 | [diff] [blame] | 37 | kPeerConnectionAddressFamilyCounter_Max, |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 38 | }; |
| 39 | |
guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 | [diff] [blame] | 40 | // TODO(guoweis): Keep previous name here until all references are renamed. |
Guo-wei Shieh | 3d564c1 | 2015-08-19 23:51:15 | [diff] [blame] | 41 | #define kBoundary kPeerConnectionAddressFamilyCounter_Max |
guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 | [diff] [blame] | 42 | |
| 43 | // TODO(guoweis): Keep previous name here until all references are renamed. |
Guo-wei Shieh | 3d564c1 | 2015-08-19 23:51:15 | [diff] [blame] | 44 | typedef PeerConnectionAddressFamilyCounter PeerConnectionUMAMetricsCounter; |
guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 | [diff] [blame] | 45 | |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 46 | // This enum defines types for UMA samples, which will have a range. |
guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 | [diff] [blame] | 47 | enum PeerConnectionMetricsName { |
| 48 | kNetworkInterfaces_IPv4, // Number of IPv4 interfaces. |
| 49 | kNetworkInterfaces_IPv6, // Number of IPv6 interfaces. |
| 50 | kTimeToConnect, // In milliseconds. |
| 51 | kLocalCandidates_IPv4, // Number of IPv4 local candidates. |
| 52 | kLocalCandidates_IPv6, // Number of IPv6 local candidates. |
| 53 | kPeerConnectionMetricsName_Max |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 54 | }; |
| 55 | |
guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 | [diff] [blame] | 56 | // TODO(guoweis): Keep previous name here until all references are renamed. |
| 57 | typedef PeerConnectionMetricsName PeerConnectionUMAMetricsName; |
| 58 | |
Guo-wei Shieh | 3d564c1 | 2015-08-19 23:51:15 | [diff] [blame] | 59 | // The IceCandidatePairType has the format of |
| 60 | // <local_candidate_type>_<remote_candidate_type>. It is recorded based on the |
| 61 | // type of candidate pair used when the PeerConnection first goes to a completed |
| 62 | // state. When BUNDLE is enabled, only the first transport gets recorded. |
| 63 | enum IceCandidatePairType { |
Guo-wei Shieh | 3cc834a | 2015-09-04 22:52:14 | [diff] [blame] | 64 | // HostHost is deprecated. It was replaced with the set of types at the bottom |
| 65 | // to report private or public host IP address. |
Guo-wei Shieh | 3d564c1 | 2015-08-19 23:51:15 | [diff] [blame] | 66 | kIceCandidatePairHostHost, |
| 67 | kIceCandidatePairHostSrflx, |
| 68 | kIceCandidatePairHostRelay, |
| 69 | kIceCandidatePairHostPrflx, |
| 70 | kIceCandidatePairSrflxHost, |
| 71 | kIceCandidatePairSrflxSrflx, |
| 72 | kIceCandidatePairSrflxRelay, |
| 73 | kIceCandidatePairSrflxPrflx, |
| 74 | kIceCandidatePairRelayHost, |
| 75 | kIceCandidatePairRelaySrflx, |
| 76 | kIceCandidatePairRelayRelay, |
| 77 | kIceCandidatePairRelayPrflx, |
| 78 | kIceCandidatePairPrflxHost, |
| 79 | kIceCandidatePairPrflxSrflx, |
| 80 | kIceCandidatePairPrflxRelay, |
Guo-wei Shieh | 3cc834a | 2015-09-04 22:52:14 | [diff] [blame] | 81 | |
Jeroen de Borst | 833979f | 2018-12-13 16:25:54 | [diff] [blame] | 82 | // The following 9 types tell whether local and remote hosts have hostname, |
| 83 | // private or public IP addresses. |
Guo-wei Shieh | 3cc834a | 2015-09-04 22:52:14 | [diff] [blame] | 84 | kIceCandidatePairHostPrivateHostPrivate, |
| 85 | kIceCandidatePairHostPrivateHostPublic, |
| 86 | kIceCandidatePairHostPublicHostPrivate, |
| 87 | kIceCandidatePairHostPublicHostPublic, |
Jeroen de Borst | 833979f | 2018-12-13 16:25:54 | [diff] [blame] | 88 | kIceCandidatePairHostNameHostName, |
| 89 | kIceCandidatePairHostNameHostPrivate, |
| 90 | kIceCandidatePairHostNameHostPublic, |
| 91 | kIceCandidatePairHostPrivateHostName, |
| 92 | kIceCandidatePairHostPublicHostName, |
Guo-wei Shieh | 3d564c1 | 2015-08-19 23:51:15 | [diff] [blame] | 93 | kIceCandidatePairMax |
| 94 | }; |
| 95 | |
Harald Alvestrand | 194939b | 2018-01-24 15:04:13 | [diff] [blame] | 96 | enum KeyExchangeProtocolType { |
| 97 | kEnumCounterKeyProtocolDtls, |
| 98 | kEnumCounterKeyProtocolSdes, |
| 99 | kEnumCounterKeyProtocolMax |
| 100 | }; |
| 101 | |
Harald Alvestrand | f9d0f1d | 2018-03-02 13:15:26 | [diff] [blame] | 102 | enum KeyExchangeProtocolMedia { |
| 103 | kEnumCounterKeyProtocolMediaTypeDtlsAudio, |
| 104 | kEnumCounterKeyProtocolMediaTypeDtlsVideo, |
| 105 | kEnumCounterKeyProtocolMediaTypeDtlsData, |
| 106 | kEnumCounterKeyProtocolMediaTypeSdesAudio, |
| 107 | kEnumCounterKeyProtocolMediaTypeSdesVideo, |
| 108 | kEnumCounterKeyProtocolMediaTypeSdesData, |
| 109 | kEnumCounterKeyProtocolMediaTypeMax |
| 110 | }; |
| 111 | |
Harald Alvestrand | 5dbb586 | 2018-02-13 22:48:00 | [diff] [blame] | 112 | enum SdpSemanticRequested { |
| 113 | kSdpSemanticRequestDefault, |
| 114 | kSdpSemanticRequestPlanB, |
| 115 | kSdpSemanticRequestUnifiedPlan, |
| 116 | kSdpSemanticRequestMax |
| 117 | }; |
| 118 | |
| 119 | enum SdpSemanticNegotiated { |
| 120 | kSdpSemanticNegotiatedNone, |
| 121 | kSdpSemanticNegotiatedPlanB, |
| 122 | kSdpSemanticNegotiatedUnifiedPlan, |
| 123 | kSdpSemanticNegotiatedMixed, |
| 124 | kSdpSemanticNegotiatedMax |
| 125 | }; |
| 126 | |
Steve Anton | 8e20f17 | 2018-03-06 18:55:04 | [diff] [blame] | 127 | // Metric which records the format of the received SDP for tracking how much the |
| 128 | // difference between Plan B and Unified Plan affect users. |
| 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). |
| 132 | kSdpFormatReceivedNoTracks, |
| 133 | // No more than one audio and one video track. Should be compatible with both |
| 134 | // Plan B and Unified Plan endpoints. |
| 135 | kSdpFormatReceivedSimple, |
| 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). |
| 138 | kSdpFormatReceivedComplexPlanB, |
| 139 | // More than one audio track or more than one video track in the Unified Plan |
| 140 | // format (e.g., two audio media sections). |
| 141 | kSdpFormatReceivedComplexUnifiedPlan, |
| 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 |
| 146 | enum AddIceCandidateResult { |
| 147 | kAddIceCandidateSuccess, |
| 148 | kAddIceCandidateFailClosed, |
| 149 | kAddIceCandidateFailNoRemoteDescription, |
| 150 | kAddIceCandidateFailNullCandidate, |
| 151 | kAddIceCandidateFailNotValid, |
| 152 | kAddIceCandidateFailNotReady, |
| 153 | kAddIceCandidateFailInAddition, |
| 154 | kAddIceCandidateFailNotUsable, |
| 155 | kAddIceCandidateMax |
| 156 | }; |
| 157 | |
Amit Hilbuch | e2a284d | 2019-03-05 20:36:31 | [diff] [blame] | 158 | // Metric for recording which api surface was used to enable simulcast. |
| 159 | enum SimulcastApiVersion { |
| 160 | kSimulcastApiVersionNone, |
| 161 | kSimulcastApiVersionLegacy, |
| 162 | kSimulcastApiVersionSpecCompliant, |
| 163 | kSimulcastApiVersionMax, |
| 164 | }; |
| 165 | |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 166 | } // namespace webrtc |
| 167 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 168 | #endif // API_UMA_METRICS_H_ |