uma_metrics.h (9313B)
1 /* 2 * Copyright 2014 The WebRTC project authors. All Rights Reserved. 3 * 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. 9 */ 10 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. 14 15 #ifndef API_UMA_METRICS_H_ 16 #define API_UMA_METRICS_H_ 17 18 namespace webrtc { 19 20 // These values are persisted to logs. Entries should not be renumbered and 21 // numeric values should never be reused. 22 enum PeerConnectionAddressFamilyCounter { 23 kPeerConnection_IPv4 = 0, 24 kPeerConnection_IPv6 = 1, 25 kBestConnections_IPv4 = 2, 26 kBestConnections_IPv6 = 3, 27 kPeerConnectionAddressFamilyCounter_Max 28 }; 29 30 // This enum defines types for UMA samples, which will have a range. 31 // These values are persisted to logs. Entries should not be renumbered and 32 // numeric values should never be reused. 33 enum PeerConnectionMetricsName { 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. 39 kPeerConnectionMetricsName_Max 40 }; 41 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. 46 // These values are persisted to logs. Entries should not be renumbered and 47 // numeric values should never be reused. 48 enum IceCandidatePairType { 49 // HostHost is deprecated. It was replaced with the set of types at the bottom 50 // to report private or public host IP address. 51 kIceCandidatePairHostHost [[deprecated]] = 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, 66 67 // The following 9 types tell whether local and remote hosts have hostname, 68 // private or public IP addresses. 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, 78 kIceCandidatePairMax 79 }; 80 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. 88 enum KeyExchangeProtocolMedia { 89 kEnumCounterKeyProtocolMediaTypeDtlsAudio = 0, 90 kEnumCounterKeyProtocolMediaTypeDtlsVideo = 1, 91 kEnumCounterKeyProtocolMediaTypeDtlsData = 2, 92 kEnumCounterKeyProtocolMediaTypeSdesAudio = 3, 93 kEnumCounterKeyProtocolMediaTypeSdesVideo = 4, 94 kEnumCounterKeyProtocolMediaTypeSdesData = 5, 95 kEnumCounterKeyProtocolMediaTypeMax 96 }; 97 98 // These values are persisted to logs. Entries should not be renumbered and 99 // numeric values should never be reused. 100 enum SdpSemanticRequested { 101 kSdpSemanticRequestDefault = 0, 102 kSdpSemanticRequestPlanB = 1, 103 kSdpSemanticRequestUnifiedPlan = 2, 104 kSdpSemanticRequestMax 105 }; 106 107 // Metric for counting the outcome of adding an ICE candidate 108 // These values are persisted to logs. Entries should not be renumbered and 109 // numeric values should never be reused. 110 enum AddIceCandidateResult { 111 kAddIceCandidateSuccess = 0, 112 kAddIceCandidateFailClosed = 1, 113 kAddIceCandidateFailNoRemoteDescription = 2, 114 kAddIceCandidateFailNullCandidate = 3, 115 kAddIceCandidateFailNotValid = 4, 116 kAddIceCandidateFailNotReady = 5, 117 kAddIceCandidateFailInAddition = 6, 118 kAddIceCandidateFailNotUsable = 7, 119 kAddIceCandidateMax 120 }; 121 122 // Metrics for reporting usage of BUNDLE. 123 // These values are persisted to logs. Entries should not be renumbered and 124 // numeric values should never be reused. 125 enum BundleUsage { 126 // There are no m-lines in the SDP, only a session description. 127 kBundleUsageEmpty = 0, 128 // Only a data channel is negotiated but BUNDLE is not negotiated. 129 kBundleUsageNoBundleDatachannelOnly = 1, 130 // BUNDLE is not negotiated and there is at most one m-line per media type, 131 kBundleUsageNoBundleSimple = 2, 132 // BUNDLE is not negotiated and there are multiple m-lines per media type, 133 kBundleUsageNoBundleComplex = 3, 134 // Only a data channel is negotiated and BUNDLE is negotiated. 135 kBundleUsageBundleDatachannelOnly = 4, 136 // BUNDLE is negotiated but there is at most one m-line per media type, 137 kBundleUsageBundleSimple = 5, 138 // BUNDLE is negotiated and there are multiple m-lines per media type, 139 kBundleUsageBundleComplex = 6, 140 // Legacy plan-b metrics. 141 kBundleUsageNoBundlePlanB = 7, 142 kBundleUsageBundlePlanB = 8, 143 kBundleUsageMax 144 }; 145 146 // Metrics for reporting configured BUNDLE policy, mapping directly to 147 // https://w3c.github.io/webrtc-pc/#rtcbundlepolicy-enum 148 // These values are persisted to logs. Entries should not be renumbered and 149 // numeric values should never be reused. 150 enum BundlePolicyUsage { 151 kBundlePolicyUsageBalanced = 0, 152 kBundlePolicyUsageMaxBundle = 1, 153 kBundlePolicyUsageMaxCompat = 2, 154 kBundlePolicyUsageMax 155 }; 156 157 // Metrics for provisional answers as described in 158 // https://datatracker.ietf.org/doc/html/rfc8829#section-4.1.10.1 159 // These values are persisted to logs. Entries should not be renumbered and 160 // numeric values should never be reused. 161 enum ProvisionalAnswerUsage { 162 kProvisionalAnswerNotUsed = 0, 163 kProvisionalAnswerLocal = 1, 164 kProvisionalAnswerRemote = 2, 165 kProvisionalAnswerMax 166 }; 167 168 // Metrics for RTCRtpMuxPolicy. The only defined value is 169 // https://w3c.github.io/webrtc-pc/#rtcrtcpmuxpolicy-enum 170 // "require" but there is a legacy option "negotiate" which 171 // was removed from the spec. 172 enum RtcpMuxPolicyUsage { 173 kRtcpMuxPolicyUsageRequire = 0, 174 kRtcpMuxPolicyUsageNegotiate = 1, 175 kRtcpMuxPolicyUsageMax 176 }; 177 178 // Metrics for SDP munging. 179 // These values are persisted to logs. Entries should not be renumbered and 180 // numeric values should never be reused. Keep in (loose) sync with 181 // SdpMungingType from Chromium's 182 // tools/metrics/histograms/metadata/web_rtc/enums.xml 183 enum SdpMungingType { 184 kNoModification = 0, 185 kUnknownModification = 1, 186 kWithoutCreateAnswer = 2, 187 kWithoutCreateOffer = 3, 188 kNumberOfContents = 4, 189 kCurrentDescriptionFailedToParse = 5, // This is an internal error. 190 // Transport-related munging. 191 kIceOptions = 20, 192 kIcePwd = 21, 193 kIceUfrag = 22, 194 kIceMode = 23, 195 kDtlsSetup = 24, 196 kMid = 25, 197 kPayloadTypes = 26, 198 kSsrcs = 27, 199 kIceOptionsRenomination = 28, 200 kDirection = 29, 201 kRtcpMux = 30, 202 kIceOptionsTrickle = 31, 203 kIceCandidateCount = 32, 204 // RTP header extension munging. 205 kRtpHeaderExtensionRemoved = 40, 206 kRtpHeaderExtensionAdded = 41, 207 kRtpHeaderExtensionModified = 42, 208 // Audio-related munging. 209 kAudioCodecsRemoved = 60, 210 kAudioCodecsAdded = 61, 211 kAudioCodecsReordered = 62, 212 kAudioCodecsAddedMultiOpus = 63, 213 kAudioCodecsAddedL16 = 64, 214 kAudioCodecsRtcpFbAudioNack = 65, 215 kAudioCodecsFmtpOpusFec = 66, 216 kAudioCodecsFmtpOpusCbr = 67, 217 kAudioCodecsFmtpOpusStereo = 68, 218 kAudioCodecsFmtpOpusDtx = 69, 219 kAudioCodecsFmtp = 70, 220 kAudioCodecsRtcpFb = 71, 221 kAudioCodecsRtcpFbRrtr = 72, 222 kAudioCodecsRtcpReducedSize = 73, 223 // Video-related munging. 224 kVideoCodecsRemoved = 80, 225 kVideoCodecsAdded = 81, 226 kVideoCodecsReordered = 82, 227 kVideoCodecsLegacySimulcast = 83, 228 kVideoCodecsFmtpH264SpsPpsIdrInKeyframe = 84, 229 kVideoCodecsFmtp = 85, 230 kVideoCodecsRtcpFb = 86, 231 kVideoCodecsAddedWithRawPacketization = 87, 232 kVideoCodecsModifiedWithRawPacketization = 88, 233 kVideoCodecsRtcpReducedSize = 89, 234 kMaxValue, 235 }; 236 237 // The outcome of setting the local description, whether SDP munging is detected 238 // and if the should be accepted or rejected. Keep in sync with 239 // SdpMungingOutcome from tools/metrics/histograms/metadata/web_rtc/enums.xml 240 enum class SdpMungingOutcome { 241 kAccepted = 0, 242 kRejected = 1, 243 kMaxValue = kRejected, 244 }; 245 246 // When adding new metrics please consider using the style described in 247 // https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md#usage 248 // instead of the legacy enums used above. 249 250 } // namespace webrtc 251 252 #endif // API_UMA_METRICS_H_