blob: 8dbfa22716ef061b3a938202c920c1911c069f87 [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,
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070036 kPeerConnectionEnumCounterMax
37};
38
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000039// Currently this contains information related to WebRTC network/transport
40// information.
41
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070042// The difference between PeerConnectionEnumCounter and
43// PeerConnectionMetricsName is that the "EnumCounter" is only counting the
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000044// occurrences of events, while "Name" has a value associated with it which is
45// used to form a histogram.
46
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000047// This enum is backed by Chromium's histograms.xml,
48// chromium/src/tools/metrics/histograms/histograms.xml
49// Existing values cannot be re-ordered and new enums must be added
50// before kBoundary.
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070051enum PeerConnectionAddressFamilyCounter {
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000052 kPeerConnection_IPv4,
53 kPeerConnection_IPv6,
54 kBestConnections_IPv4,
55 kBestConnections_IPv6,
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070056 kPeerConnectionAddressFamilyCounter_Max,
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000057};
58
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000059// TODO(guoweis): Keep previous name here until all references are renamed.
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070060#define kBoundary kPeerConnectionAddressFamilyCounter_Max
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000061
62// TODO(guoweis): Keep previous name here until all references are renamed.
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070063typedef PeerConnectionAddressFamilyCounter PeerConnectionUMAMetricsCounter;
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000064
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000065// This enum defines types for UMA samples, which will have a range.
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000066enum PeerConnectionMetricsName {
67 kNetworkInterfaces_IPv4, // Number of IPv4 interfaces.
68 kNetworkInterfaces_IPv6, // Number of IPv6 interfaces.
69 kTimeToConnect, // In milliseconds.
70 kLocalCandidates_IPv4, // Number of IPv4 local candidates.
71 kLocalCandidates_IPv6, // Number of IPv6 local candidates.
72 kPeerConnectionMetricsName_Max
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000073};
74
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000075// TODO(guoweis): Keep previous name here until all references are renamed.
76typedef PeerConnectionMetricsName PeerConnectionUMAMetricsName;
77
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070078// The IceCandidatePairType has the format of
79// <local_candidate_type>_<remote_candidate_type>. It is recorded based on the
80// type of candidate pair used when the PeerConnection first goes to a completed
81// state. When BUNDLE is enabled, only the first transport gets recorded.
82enum IceCandidatePairType {
Guo-wei Shieh3cc834a2015-09-04 15:52:14 -070083 // HostHost is deprecated. It was replaced with the set of types at the bottom
84 // to report private or public host IP address.
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070085 kIceCandidatePairHostHost,
86 kIceCandidatePairHostSrflx,
87 kIceCandidatePairHostRelay,
88 kIceCandidatePairHostPrflx,
89 kIceCandidatePairSrflxHost,
90 kIceCandidatePairSrflxSrflx,
91 kIceCandidatePairSrflxRelay,
92 kIceCandidatePairSrflxPrflx,
93 kIceCandidatePairRelayHost,
94 kIceCandidatePairRelaySrflx,
95 kIceCandidatePairRelayRelay,
96 kIceCandidatePairRelayPrflx,
97 kIceCandidatePairPrflxHost,
98 kIceCandidatePairPrflxSrflx,
99 kIceCandidatePairPrflxRelay,
Guo-wei Shieh3cc834a2015-09-04 15:52:14 -0700100
101 // The following 4 types tell whether local and remote hosts have private or
102 // public IP addresses.
103 kIceCandidatePairHostPrivateHostPrivate,
104 kIceCandidatePairHostPrivateHostPublic,
105 kIceCandidatePairHostPublicHostPrivate,
106 kIceCandidatePairHostPublicHostPublic,
Guo-wei Shieh3d564c12015-08-19 16:51:15 -0700107 kIceCandidatePairMax
108};
109
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +0000110} // namespace webrtc
111
Henrik Kjellander15583c12016-02-10 10:53:12 +0100112#endif // WEBRTC_API_UMAMETRICS_H_