blob: 93c034f7c253d47e19c75e458048b0bf8e15f910 [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
Henrik Kjellander15583c12016-02-10 10:53:12 +010013#ifndef WEBRTC_API_UMAMETRICS_H_
14#define WEBRTC_API_UMAMETRICS_H_
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000015
16namespace webrtc {
17
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070018// Used to specify which enum counter type we're incrementing in
19// MetricsObserverInterface::IncrementEnumCounter.
20enum PeerConnectionEnumCounterType {
21 kEnumCounterAddressFamily,
22 // For the next 2 counters, we track them separately based on the "first hop"
23 // protocol used by the local candidate. "First hop" means the local candidate
24 // type in the case of non-TURN candidates, and the protocol used to connect
25 // to the TURN server in the case of TURN candidates.
26 kEnumCounterIceCandidatePairTypeUdp,
27 kEnumCounterIceCandidatePairTypeTcp,
Guo-wei Shieh456696a2015-09-30 21:48:54 -070028
29 kEnumCounterAudioSrtpCipher,
30 kEnumCounterAudioSslCipher,
31 kEnumCounterVideoSrtpCipher,
32 kEnumCounterVideoSslCipher,
33 kEnumCounterDataSrtpCipher,
34 kEnumCounterDataSslCipher,
zhihuangd82eee02016-08-26 11:25:05 -070035 kEnumCounterDtlsHandshakeError,
Honghai Zhangd93f50c2016-10-05 11:47:22 -070036 kEnumCounterIceRegathering,
37 kEnumCounterIceRestart,
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070038 kPeerConnectionEnumCounterMax
39};
40
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000041// Currently this contains information related to WebRTC network/transport
42// information.
43
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070044// The difference between PeerConnectionEnumCounter and
45// PeerConnectionMetricsName is that the "EnumCounter" is only counting the
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000046// occurrences of events, while "Name" has a value associated with it which is
47// used to form a histogram.
48
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000049// This enum is backed by Chromium's histograms.xml,
50// chromium/src/tools/metrics/histograms/histograms.xml
51// Existing values cannot be re-ordered and new enums must be added
52// before kBoundary.
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070053enum PeerConnectionAddressFamilyCounter {
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000054 kPeerConnection_IPv4,
55 kPeerConnection_IPv6,
56 kBestConnections_IPv4,
57 kBestConnections_IPv6,
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070058 kPeerConnectionAddressFamilyCounter_Max,
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000059};
60
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000061// TODO(guoweis): Keep previous name here until all references are renamed.
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070062#define kBoundary kPeerConnectionAddressFamilyCounter_Max
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000063
64// TODO(guoweis): Keep previous name here until all references are renamed.
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070065typedef PeerConnectionAddressFamilyCounter PeerConnectionUMAMetricsCounter;
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000066
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000067// This enum defines types for UMA samples, which will have a range.
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000068enum PeerConnectionMetricsName {
69 kNetworkInterfaces_IPv4, // Number of IPv4 interfaces.
70 kNetworkInterfaces_IPv6, // Number of IPv6 interfaces.
71 kTimeToConnect, // In milliseconds.
72 kLocalCandidates_IPv4, // Number of IPv4 local candidates.
73 kLocalCandidates_IPv6, // Number of IPv6 local candidates.
74 kPeerConnectionMetricsName_Max
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000075};
76
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000077// TODO(guoweis): Keep previous name here until all references are renamed.
78typedef PeerConnectionMetricsName PeerConnectionUMAMetricsName;
79
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070080// The IceCandidatePairType has the format of
81// <local_candidate_type>_<remote_candidate_type>. It is recorded based on the
82// type of candidate pair used when the PeerConnection first goes to a completed
83// state. When BUNDLE is enabled, only the first transport gets recorded.
84enum IceCandidatePairType {
Guo-wei Shieh3cc834a2015-09-04 15:52:14 -070085 // HostHost is deprecated. It was replaced with the set of types at the bottom
86 // to report private or public host IP address.
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070087 kIceCandidatePairHostHost,
88 kIceCandidatePairHostSrflx,
89 kIceCandidatePairHostRelay,
90 kIceCandidatePairHostPrflx,
91 kIceCandidatePairSrflxHost,
92 kIceCandidatePairSrflxSrflx,
93 kIceCandidatePairSrflxRelay,
94 kIceCandidatePairSrflxPrflx,
95 kIceCandidatePairRelayHost,
96 kIceCandidatePairRelaySrflx,
97 kIceCandidatePairRelayRelay,
98 kIceCandidatePairRelayPrflx,
99 kIceCandidatePairPrflxHost,
100 kIceCandidatePairPrflxSrflx,
101 kIceCandidatePairPrflxRelay,
Guo-wei Shieh3cc834a2015-09-04 15:52:14 -0700102
103 // The following 4 types tell whether local and remote hosts have private or
104 // public IP addresses.
105 kIceCandidatePairHostPrivateHostPrivate,
106 kIceCandidatePairHostPrivateHostPublic,
107 kIceCandidatePairHostPublicHostPrivate,
108 kIceCandidatePairHostPublicHostPublic,
Guo-wei Shieh3d564c12015-08-19 16:51:15 -0700109 kIceCandidatePairMax
110};
111
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +0000112} // namespace webrtc
113
Henrik Kjellander15583c12016-02-10 10:53:12 +0100114#endif // WEBRTC_API_UMAMETRICS_H_