buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 1 | /* |
kjellander | b24317b | 2016-02-10 07:54:43 -0800 | [diff] [blame] | 2 | * Copyright 2014 The WebRTC project authors. All Rights Reserved. |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 3 | * |
kjellander | b24317b | 2016-02-10 07:54:43 -0800 | [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 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | // This file contains enums related to IPv4/IPv6 metrics. |
| 12 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 13 | #ifndef API_UMA_METRICS_H_ |
| 14 | #define API_UMA_METRICS_H_ |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 15 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 16 | #include "rtc_base/ref_count.h" |
skvlad | 1d3c7e0 | 2017-01-11 17:50:30 -0800 | [diff] [blame] | 17 | |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [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 16:51:15 -0700 | [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 +0000 | [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 +0000 | [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 16:51:15 -0700 | [diff] [blame] | 32 | enum PeerConnectionAddressFamilyCounter { |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 33 | kPeerConnection_IPv4, |
| 34 | kPeerConnection_IPv6, |
| 35 | kBestConnections_IPv4, |
| 36 | kBestConnections_IPv6, |
Guo-wei Shieh | 3d564c1 | 2015-08-19 16:51:15 -0700 | [diff] [blame] | 37 | kPeerConnectionAddressFamilyCounter_Max, |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 38 | }; |
| 39 | |
| 40 | // This enum defines types for UMA samples, which will have a range. |
guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 +0000 | [diff] [blame] | 41 | enum PeerConnectionMetricsName { |
| 42 | kNetworkInterfaces_IPv4, // Number of IPv4 interfaces. |
| 43 | kNetworkInterfaces_IPv6, // Number of IPv6 interfaces. |
| 44 | kTimeToConnect, // In milliseconds. |
| 45 | kLocalCandidates_IPv4, // Number of IPv4 local candidates. |
| 46 | kLocalCandidates_IPv6, // Number of IPv6 local candidates. |
| 47 | kPeerConnectionMetricsName_Max |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 48 | }; |
| 49 | |
Guo-wei Shieh | 3d564c1 | 2015-08-19 16:51:15 -0700 | [diff] [blame] | 50 | // The IceCandidatePairType has the format of |
| 51 | // <local_candidate_type>_<remote_candidate_type>. It is recorded based on the |
| 52 | // type of candidate pair used when the PeerConnection first goes to a completed |
| 53 | // state. When BUNDLE is enabled, only the first transport gets recorded. |
| 54 | enum IceCandidatePairType { |
Guo-wei Shieh | 3cc834a | 2015-09-04 15:52:14 -0700 | [diff] [blame] | 55 | // HostHost is deprecated. It was replaced with the set of types at the bottom |
| 56 | // to report private or public host IP address. |
Guo-wei Shieh | 3d564c1 | 2015-08-19 16:51:15 -0700 | [diff] [blame] | 57 | kIceCandidatePairHostHost, |
| 58 | kIceCandidatePairHostSrflx, |
| 59 | kIceCandidatePairHostRelay, |
| 60 | kIceCandidatePairHostPrflx, |
| 61 | kIceCandidatePairSrflxHost, |
| 62 | kIceCandidatePairSrflxSrflx, |
| 63 | kIceCandidatePairSrflxRelay, |
| 64 | kIceCandidatePairSrflxPrflx, |
| 65 | kIceCandidatePairRelayHost, |
| 66 | kIceCandidatePairRelaySrflx, |
| 67 | kIceCandidatePairRelayRelay, |
| 68 | kIceCandidatePairRelayPrflx, |
| 69 | kIceCandidatePairPrflxHost, |
| 70 | kIceCandidatePairPrflxSrflx, |
| 71 | kIceCandidatePairPrflxRelay, |
Guo-wei Shieh | 3cc834a | 2015-09-04 15:52:14 -0700 | [diff] [blame] | 72 | |
Jeroen de Borst | 833979f | 2018-12-13 08:25:54 -0800 | [diff] [blame] | 73 | // The following 9 types tell whether local and remote hosts have hostname, |
| 74 | // private or public IP addresses. |
Guo-wei Shieh | 3cc834a | 2015-09-04 15:52:14 -0700 | [diff] [blame] | 75 | kIceCandidatePairHostPrivateHostPrivate, |
| 76 | kIceCandidatePairHostPrivateHostPublic, |
| 77 | kIceCandidatePairHostPublicHostPrivate, |
| 78 | kIceCandidatePairHostPublicHostPublic, |
Jeroen de Borst | 833979f | 2018-12-13 08:25:54 -0800 | [diff] [blame] | 79 | kIceCandidatePairHostNameHostName, |
| 80 | kIceCandidatePairHostNameHostPrivate, |
| 81 | kIceCandidatePairHostNameHostPublic, |
| 82 | kIceCandidatePairHostPrivateHostName, |
| 83 | kIceCandidatePairHostPublicHostName, |
Guo-wei Shieh | 3d564c1 | 2015-08-19 16:51:15 -0700 | [diff] [blame] | 84 | kIceCandidatePairMax |
| 85 | }; |
| 86 | |
Harald Alvestrand | 194939b | 2018-01-24 16:04:13 +0100 | [diff] [blame] | 87 | enum KeyExchangeProtocolType { |
| 88 | kEnumCounterKeyProtocolDtls, |
| 89 | kEnumCounterKeyProtocolSdes, |
| 90 | kEnumCounterKeyProtocolMax |
| 91 | }; |
| 92 | |
Harald Alvestrand | f9d0f1d | 2018-03-02 14:15:26 +0100 | [diff] [blame] | 93 | enum KeyExchangeProtocolMedia { |
| 94 | kEnumCounterKeyProtocolMediaTypeDtlsAudio, |
| 95 | kEnumCounterKeyProtocolMediaTypeDtlsVideo, |
| 96 | kEnumCounterKeyProtocolMediaTypeDtlsData, |
| 97 | kEnumCounterKeyProtocolMediaTypeSdesAudio, |
| 98 | kEnumCounterKeyProtocolMediaTypeSdesVideo, |
| 99 | kEnumCounterKeyProtocolMediaTypeSdesData, |
| 100 | kEnumCounterKeyProtocolMediaTypeMax |
| 101 | }; |
| 102 | |
Harald Alvestrand | 5dbb586 | 2018-02-13 23:48:00 +0100 | [diff] [blame] | 103 | enum SdpSemanticRequested { |
| 104 | kSdpSemanticRequestDefault, |
| 105 | kSdpSemanticRequestPlanB, |
| 106 | kSdpSemanticRequestUnifiedPlan, |
| 107 | kSdpSemanticRequestMax |
| 108 | }; |
| 109 | |
| 110 | enum SdpSemanticNegotiated { |
| 111 | kSdpSemanticNegotiatedNone, |
| 112 | kSdpSemanticNegotiatedPlanB, |
| 113 | kSdpSemanticNegotiatedUnifiedPlan, |
| 114 | kSdpSemanticNegotiatedMixed, |
| 115 | kSdpSemanticNegotiatedMax |
| 116 | }; |
| 117 | |
Steve Anton | 8e20f17 | 2018-03-06 10:55:04 -0800 | [diff] [blame] | 118 | // Metric which records the format of the received SDP for tracking how much the |
| 119 | // difference between Plan B and Unified Plan affect users. |
| 120 | enum SdpFormatReceived { |
| 121 | // No audio or video tracks. This is worth special casing since it seems to be |
| 122 | // the most common scenario (data-channel only). |
| 123 | kSdpFormatReceivedNoTracks, |
| 124 | // No more than one audio and one video track. Should be compatible with both |
| 125 | // Plan B and Unified Plan endpoints. |
| 126 | kSdpFormatReceivedSimple, |
| 127 | // More than one audio track or more than one video track in the Plan B format |
| 128 | // (e.g., one audio media section with multiple streams). |
| 129 | kSdpFormatReceivedComplexPlanB, |
| 130 | // More than one audio track or more than one video track in the Unified Plan |
| 131 | // format (e.g., two audio media sections). |
| 132 | kSdpFormatReceivedComplexUnifiedPlan, |
| 133 | kSdpFormatReceivedMax |
| 134 | }; |
| 135 | |
Harald Alvestrand | 76829d7 | 2018-07-18 23:24:36 +0200 | [diff] [blame] | 136 | // Metric for counting the outcome of adding an ICE candidate |
| 137 | enum AddIceCandidateResult { |
| 138 | kAddIceCandidateSuccess, |
| 139 | kAddIceCandidateFailClosed, |
| 140 | kAddIceCandidateFailNoRemoteDescription, |
| 141 | kAddIceCandidateFailNullCandidate, |
| 142 | kAddIceCandidateFailNotValid, |
| 143 | kAddIceCandidateFailNotReady, |
| 144 | kAddIceCandidateFailInAddition, |
| 145 | kAddIceCandidateFailNotUsable, |
| 146 | kAddIceCandidateMax |
| 147 | }; |
| 148 | |
Amit Hilbuch | e2a284d | 2019-03-05 12:36:31 -0800 | [diff] [blame] | 149 | // Metric for recording which api surface was used to enable simulcast. |
| 150 | enum SimulcastApiVersion { |
| 151 | kSimulcastApiVersionNone, |
| 152 | kSimulcastApiVersionLegacy, |
| 153 | kSimulcastApiVersionSpecCompliant, |
| 154 | kSimulcastApiVersionMax, |
| 155 | }; |
| 156 | |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 157 | } // namespace webrtc |
| 158 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 159 | #endif // API_UMA_METRICS_H_ |