| 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 |  | 
| Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 13 | #ifndef API_UMAMETRICS_H_ | 
|  | 14 | #define API_UMAMETRICS_H_ | 
| buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 15 |  | 
| Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 16 | #include "rtc_base/refcount.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 |  | 
| guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 +0000 | [diff] [blame] | 40 | // TODO(guoweis): Keep previous name here until all references are renamed. | 
| Guo-wei Shieh | 3d564c1 | 2015-08-19 16:51:15 -0700 | [diff] [blame] | 41 | #define kBoundary kPeerConnectionAddressFamilyCounter_Max | 
| guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 +0000 | [diff] [blame] | 42 |  | 
|  | 43 | // TODO(guoweis): Keep previous name here until all references are renamed. | 
| Guo-wei Shieh | 3d564c1 | 2015-08-19 16:51:15 -0700 | [diff] [blame] | 44 | typedef PeerConnectionAddressFamilyCounter PeerConnectionUMAMetricsCounter; | 
| guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 +0000 | [diff] [blame] | 45 |  | 
| buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [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 +0000 | [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 +0000 | [diff] [blame] | 54 | }; | 
|  | 55 |  | 
| guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 +0000 | [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 16:51:15 -0700 | [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 15:52:14 -0700 | [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 16:51:15 -0700 | [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 15:52:14 -0700 | [diff] [blame] | 81 |  | 
|  | 82 | // The following 4 types tell whether local and remote hosts have private or | 
|  | 83 | // public IP addresses. | 
|  | 84 | kIceCandidatePairHostPrivateHostPrivate, | 
|  | 85 | kIceCandidatePairHostPrivateHostPublic, | 
|  | 86 | kIceCandidatePairHostPublicHostPrivate, | 
|  | 87 | kIceCandidatePairHostPublicHostPublic, | 
| Guo-wei Shieh | 3d564c1 | 2015-08-19 16:51:15 -0700 | [diff] [blame] | 88 | kIceCandidatePairMax | 
|  | 89 | }; | 
|  | 90 |  | 
| Harald Alvestrand | 194939b | 2018-01-24 16:04:13 +0100 | [diff] [blame] | 91 | enum KeyExchangeProtocolType { | 
|  | 92 | kEnumCounterKeyProtocolDtls, | 
|  | 93 | kEnumCounterKeyProtocolSdes, | 
|  | 94 | kEnumCounterKeyProtocolMax | 
|  | 95 | }; | 
|  | 96 |  | 
| Harald Alvestrand | f9d0f1d | 2018-03-02 14:15:26 +0100 | [diff] [blame] | 97 | enum KeyExchangeProtocolMedia { | 
|  | 98 | kEnumCounterKeyProtocolMediaTypeDtlsAudio, | 
|  | 99 | kEnumCounterKeyProtocolMediaTypeDtlsVideo, | 
|  | 100 | kEnumCounterKeyProtocolMediaTypeDtlsData, | 
|  | 101 | kEnumCounterKeyProtocolMediaTypeSdesAudio, | 
|  | 102 | kEnumCounterKeyProtocolMediaTypeSdesVideo, | 
|  | 103 | kEnumCounterKeyProtocolMediaTypeSdesData, | 
|  | 104 | kEnumCounterKeyProtocolMediaTypeMax | 
|  | 105 | }; | 
|  | 106 |  | 
| Harald Alvestrand | 5dbb586 | 2018-02-13 23:48:00 +0100 | [diff] [blame] | 107 | enum SdpSemanticRequested { | 
|  | 108 | kSdpSemanticRequestDefault, | 
|  | 109 | kSdpSemanticRequestPlanB, | 
|  | 110 | kSdpSemanticRequestUnifiedPlan, | 
|  | 111 | kSdpSemanticRequestMax | 
|  | 112 | }; | 
|  | 113 |  | 
|  | 114 | enum SdpSemanticNegotiated { | 
|  | 115 | kSdpSemanticNegotiatedNone, | 
|  | 116 | kSdpSemanticNegotiatedPlanB, | 
|  | 117 | kSdpSemanticNegotiatedUnifiedPlan, | 
|  | 118 | kSdpSemanticNegotiatedMixed, | 
|  | 119 | kSdpSemanticNegotiatedMax | 
|  | 120 | }; | 
|  | 121 |  | 
| Steve Anton | 8e20f17 | 2018-03-06 10:55:04 -0800 | [diff] [blame] | 122 | // Metric which records the format of the received SDP for tracking how much the | 
|  | 123 | // difference between Plan B and Unified Plan affect users. | 
|  | 124 | enum SdpFormatReceived { | 
|  | 125 | // No audio or video tracks. This is worth special casing since it seems to be | 
|  | 126 | // the most common scenario (data-channel only). | 
|  | 127 | kSdpFormatReceivedNoTracks, | 
|  | 128 | // No more than one audio and one video track. Should be compatible with both | 
|  | 129 | // Plan B and Unified Plan endpoints. | 
|  | 130 | kSdpFormatReceivedSimple, | 
|  | 131 | // More than one audio track or more than one video track in the Plan B format | 
|  | 132 | // (e.g., one audio media section with multiple streams). | 
|  | 133 | kSdpFormatReceivedComplexPlanB, | 
|  | 134 | // More than one audio track or more than one video track in the Unified Plan | 
|  | 135 | // format (e.g., two audio media sections). | 
|  | 136 | kSdpFormatReceivedComplexUnifiedPlan, | 
|  | 137 | kSdpFormatReceivedMax | 
|  | 138 | }; | 
|  | 139 |  | 
| Harald Alvestrand | 76829d7 | 2018-07-18 23:24:36 +0200 | [diff] [blame] | 140 | // Metric for counting the outcome of adding an ICE candidate | 
|  | 141 | enum AddIceCandidateResult { | 
|  | 142 | kAddIceCandidateSuccess, | 
|  | 143 | kAddIceCandidateFailClosed, | 
|  | 144 | kAddIceCandidateFailNoRemoteDescription, | 
|  | 145 | kAddIceCandidateFailNullCandidate, | 
|  | 146 | kAddIceCandidateFailNotValid, | 
|  | 147 | kAddIceCandidateFailNotReady, | 
|  | 148 | kAddIceCandidateFailInAddition, | 
|  | 149 | kAddIceCandidateFailNotUsable, | 
|  | 150 | kAddIceCandidateMax | 
|  | 151 | }; | 
|  | 152 |  | 
| buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 153 | }  // namespace webrtc | 
|  | 154 |  | 
| Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 155 | #endif  // API_UMAMETRICS_H_ |