| 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 = 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 | // When adding new metrics please consider using the style described in |
| 179 | // https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md#usage |
| 180 | // instead of the legacy enums used above. |
| 181 |
| 182 | } // namespace webrtc |
| 183 |
| 184 | #endif // API_UMA_METRICS_H_ |
| 185 |