blob: 88ab08c1bef9a68a437d18f29a9e35adda5d4bb4 [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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020013#ifndef API_UMAMETRICS_H_
14#define API_UMAMETRICS_H_
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000015
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020016#include "rtc_base/refcount.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
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 Shieh3d564c12015-08-19 16:51:15 -070088 kIceCandidatePairMax
89};
90
Harald Alvestrand194939b2018-01-24 16:04:13 +010091enum KeyExchangeProtocolType {
92 kEnumCounterKeyProtocolDtls,
93 kEnumCounterKeyProtocolSdes,
94 kEnumCounterKeyProtocolMax
95};
96
Harald Alvestrandf9d0f1d2018-03-02 14:15:26 +010097enum KeyExchangeProtocolMedia {
98 kEnumCounterKeyProtocolMediaTypeDtlsAudio,
99 kEnumCounterKeyProtocolMediaTypeDtlsVideo,
100 kEnumCounterKeyProtocolMediaTypeDtlsData,
101 kEnumCounterKeyProtocolMediaTypeSdesAudio,
102 kEnumCounterKeyProtocolMediaTypeSdesVideo,
103 kEnumCounterKeyProtocolMediaTypeSdesData,
104 kEnumCounterKeyProtocolMediaTypeMax
105};
106
Harald Alvestrand5dbb5862018-02-13 23:48:00 +0100107enum SdpSemanticRequested {
108 kSdpSemanticRequestDefault,
109 kSdpSemanticRequestPlanB,
110 kSdpSemanticRequestUnifiedPlan,
111 kSdpSemanticRequestMax
112};
113
114enum SdpSemanticNegotiated {
115 kSdpSemanticNegotiatedNone,
116 kSdpSemanticNegotiatedPlanB,
117 kSdpSemanticNegotiatedUnifiedPlan,
118 kSdpSemanticNegotiatedMixed,
119 kSdpSemanticNegotiatedMax
120};
121
Steve Anton8e20f172018-03-06 10:55:04 -0800122// Metric which records the format of the received SDP for tracking how much the
123// difference between Plan B and Unified Plan affect users.
124enum 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 Alvestrand76829d72018-07-18 23:24:36 +0200140// Metric for counting the outcome of adding an ICE candidate
141enum AddIceCandidateResult {
142 kAddIceCandidateSuccess,
143 kAddIceCandidateFailClosed,
144 kAddIceCandidateFailNoRemoteDescription,
145 kAddIceCandidateFailNullCandidate,
146 kAddIceCandidateFailNotValid,
147 kAddIceCandidateFailNotReady,
148 kAddIceCandidateFailInAddition,
149 kAddIceCandidateFailNotUsable,
150 kAddIceCandidateMax
151};
152
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +0000153} // namespace webrtc
154
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200155#endif // API_UMAMETRICS_H_