blob: 51b0ff06c89eb1c0ee3bd4511eb3180fb813a120 [file] [log] [blame]
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +00001/*
kjellanderb24317b2016-02-10 07:54:43 -08002 * Copyright 2014 The WebRTC project authors. All Rights Reserved.
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +00003 *
kjellanderb24317b2016-02-10 07:54:43 -08004 * 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.org1567b8c2014-05-08 19:54:16 +00009 */
10
11// This file contains enums related to IPv4/IPv6 metrics.
12
Steve Anton10542f22019-01-11 09:11:00 -080013#ifndef API_UMA_METRICS_H_
14#define API_UMA_METRICS_H_
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000015
Steve Anton10542f22019-01-11 09:11:00 -080016#include "rtc_base/ref_count.h"
skvlad1d3c7e02017-01-11 17:50:30 -080017
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000018namespace webrtc {
19
20// Currently this contains information related to WebRTC network/transport
21// information.
22
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070023// The difference between PeerConnectionEnumCounter and
24// PeerConnectionMetricsName is that the "EnumCounter" is only counting the
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000025// occurrences of events, while "Name" has a value associated with it which is
26// used to form a histogram.
27
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000028// 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 Shieh3d564c12015-08-19 16:51:15 -070032enum PeerConnectionAddressFamilyCounter {
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000033 kPeerConnection_IPv4,
34 kPeerConnection_IPv6,
35 kBestConnections_IPv4,
36 kBestConnections_IPv6,
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070037 kPeerConnectionAddressFamilyCounter_Max,
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000038};
39
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000040// TODO(guoweis): Keep previous name here until all references are renamed.
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070041#define kBoundary kPeerConnectionAddressFamilyCounter_Max
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000042
43// TODO(guoweis): Keep previous name here until all references are renamed.
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070044typedef PeerConnectionAddressFamilyCounter PeerConnectionUMAMetricsCounter;
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000045
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000046// This enum defines types for UMA samples, which will have a range.
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000047enum 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.org1567b8c2014-05-08 19:54:16 +000054};
55
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000056// TODO(guoweis): Keep previous name here until all references are renamed.
57typedef PeerConnectionMetricsName PeerConnectionUMAMetricsName;
58
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070059// 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.
63enum IceCandidatePairType {
Guo-wei Shieh3cc834a2015-09-04 15:52:14 -070064 // 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 Shieh3d564c12015-08-19 16:51:15 -070066 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 Shieh3cc834a2015-09-04 15:52:14 -070081
Jeroen de Borst833979f2018-12-13 08:25:54 -080082 // The following 9 types tell whether local and remote hosts have hostname,
83 // private or public IP addresses.
Guo-wei Shieh3cc834a2015-09-04 15:52:14 -070084 kIceCandidatePairHostPrivateHostPrivate,
85 kIceCandidatePairHostPrivateHostPublic,
86 kIceCandidatePairHostPublicHostPrivate,
87 kIceCandidatePairHostPublicHostPublic,
Jeroen de Borst833979f2018-12-13 08:25:54 -080088 kIceCandidatePairHostNameHostName,
89 kIceCandidatePairHostNameHostPrivate,
90 kIceCandidatePairHostNameHostPublic,
91 kIceCandidatePairHostPrivateHostName,
92 kIceCandidatePairHostPublicHostName,
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070093 kIceCandidatePairMax
94};
95
Harald Alvestrand194939b2018-01-24 16:04:13 +010096enum KeyExchangeProtocolType {
97 kEnumCounterKeyProtocolDtls,
98 kEnumCounterKeyProtocolSdes,
99 kEnumCounterKeyProtocolMax
100};
101
Harald Alvestrandf9d0f1d2018-03-02 14:15:26 +0100102enum KeyExchangeProtocolMedia {
103 kEnumCounterKeyProtocolMediaTypeDtlsAudio,
104 kEnumCounterKeyProtocolMediaTypeDtlsVideo,
105 kEnumCounterKeyProtocolMediaTypeDtlsData,
106 kEnumCounterKeyProtocolMediaTypeSdesAudio,
107 kEnumCounterKeyProtocolMediaTypeSdesVideo,
108 kEnumCounterKeyProtocolMediaTypeSdesData,
109 kEnumCounterKeyProtocolMediaTypeMax
110};
111
Harald Alvestrand5dbb5862018-02-13 23:48:00 +0100112enum SdpSemanticRequested {
113 kSdpSemanticRequestDefault,
114 kSdpSemanticRequestPlanB,
115 kSdpSemanticRequestUnifiedPlan,
116 kSdpSemanticRequestMax
117};
118
119enum SdpSemanticNegotiated {
120 kSdpSemanticNegotiatedNone,
121 kSdpSemanticNegotiatedPlanB,
122 kSdpSemanticNegotiatedUnifiedPlan,
123 kSdpSemanticNegotiatedMixed,
124 kSdpSemanticNegotiatedMax
125};
126
Steve Anton8e20f172018-03-06 10:55:04 -0800127// Metric which records the format of the received SDP for tracking how much the
128// difference between Plan B and Unified Plan affect users.
129enum 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 Alvestrand76829d72018-07-18 23:24:36 +0200145// Metric for counting the outcome of adding an ICE candidate
146enum AddIceCandidateResult {
147 kAddIceCandidateSuccess,
148 kAddIceCandidateFailClosed,
149 kAddIceCandidateFailNoRemoteDescription,
150 kAddIceCandidateFailNullCandidate,
151 kAddIceCandidateFailNotValid,
152 kAddIceCandidateFailNotReady,
153 kAddIceCandidateFailInAddition,
154 kAddIceCandidateFailNotUsable,
155 kAddIceCandidateMax
156};
157
Amit Hilbuche2a284d2019-03-05 12:36:31 -0800158// Metric for recording which api surface was used to enable simulcast.
159enum SimulcastApiVersion {
160 kSimulcastApiVersionNone,
161 kSimulcastApiVersionLegacy,
162 kSimulcastApiVersionSpecCompliant,
163 kSimulcastApiVersionMax,
164};
165
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +0000166} // namespace webrtc
167
Steve Anton10542f22019-01-11 09:11:00 -0800168#endif // API_UMA_METRICS_H_