blob: 8436d4f9e55c82839b2497760e19b52c48f943c9 [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
40// This enum defines types for UMA samples, which will have a range.
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000041enum 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.org1567b8c2014-05-08 19:54:16 +000048};
49
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070050// 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.
54enum IceCandidatePairType {
Guo-wei Shieh3cc834a2015-09-04 15:52:14 -070055 // 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 Shieh3d564c12015-08-19 16:51:15 -070057 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 Shieh3cc834a2015-09-04 15:52:14 -070072
Jeroen de Borst833979f2018-12-13 08:25:54 -080073 // The following 9 types tell whether local and remote hosts have hostname,
74 // private or public IP addresses.
Guo-wei Shieh3cc834a2015-09-04 15:52:14 -070075 kIceCandidatePairHostPrivateHostPrivate,
76 kIceCandidatePairHostPrivateHostPublic,
77 kIceCandidatePairHostPublicHostPrivate,
78 kIceCandidatePairHostPublicHostPublic,
Jeroen de Borst833979f2018-12-13 08:25:54 -080079 kIceCandidatePairHostNameHostName,
80 kIceCandidatePairHostNameHostPrivate,
81 kIceCandidatePairHostNameHostPublic,
82 kIceCandidatePairHostPrivateHostName,
83 kIceCandidatePairHostPublicHostName,
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070084 kIceCandidatePairMax
85};
86
Harald Alvestrand194939b2018-01-24 16:04:13 +010087enum KeyExchangeProtocolType {
88 kEnumCounterKeyProtocolDtls,
89 kEnumCounterKeyProtocolSdes,
90 kEnumCounterKeyProtocolMax
91};
92
Harald Alvestrandf9d0f1d2018-03-02 14:15:26 +010093enum KeyExchangeProtocolMedia {
94 kEnumCounterKeyProtocolMediaTypeDtlsAudio,
95 kEnumCounterKeyProtocolMediaTypeDtlsVideo,
96 kEnumCounterKeyProtocolMediaTypeDtlsData,
97 kEnumCounterKeyProtocolMediaTypeSdesAudio,
98 kEnumCounterKeyProtocolMediaTypeSdesVideo,
99 kEnumCounterKeyProtocolMediaTypeSdesData,
100 kEnumCounterKeyProtocolMediaTypeMax
101};
102
Harald Alvestrand5dbb5862018-02-13 23:48:00 +0100103enum SdpSemanticRequested {
104 kSdpSemanticRequestDefault,
105 kSdpSemanticRequestPlanB,
106 kSdpSemanticRequestUnifiedPlan,
107 kSdpSemanticRequestMax
108};
109
110enum SdpSemanticNegotiated {
111 kSdpSemanticNegotiatedNone,
112 kSdpSemanticNegotiatedPlanB,
113 kSdpSemanticNegotiatedUnifiedPlan,
114 kSdpSemanticNegotiatedMixed,
115 kSdpSemanticNegotiatedMax
116};
117
Steve Anton8e20f172018-03-06 10:55:04 -0800118// Metric which records the format of the received SDP for tracking how much the
119// difference between Plan B and Unified Plan affect users.
120enum 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 Alvestrand76829d72018-07-18 23:24:36 +0200136// Metric for counting the outcome of adding an ICE candidate
137enum AddIceCandidateResult {
138 kAddIceCandidateSuccess,
139 kAddIceCandidateFailClosed,
140 kAddIceCandidateFailNoRemoteDescription,
141 kAddIceCandidateFailNullCandidate,
142 kAddIceCandidateFailNotValid,
143 kAddIceCandidateFailNotReady,
144 kAddIceCandidateFailInAddition,
145 kAddIceCandidateFailNotUsable,
146 kAddIceCandidateMax
147};
148
Amit Hilbuche2a284d2019-03-05 12:36:31 -0800149// Metric for recording which api surface was used to enable simulcast.
150enum SimulcastApiVersion {
151 kSimulcastApiVersionNone,
152 kSimulcastApiVersionLegacy,
153 kSimulcastApiVersionSpecCompliant,
154 kSimulcastApiVersionMax,
155};
156
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +0000157} // namespace webrtc
158
Steve Anton10542f22019-01-11 09:11:00 -0800159#endif // API_UMA_METRICS_H_