blob: 5374716133f99c3840797af8ea9000ccd455ec3e [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,
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070035 kPeerConnectionEnumCounterMax
36};
37
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000038// Currently this contains information related to WebRTC network/transport
39// information.
40
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070041// The difference between PeerConnectionEnumCounter and
42// PeerConnectionMetricsName is that the "EnumCounter" is only counting the
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000043// occurrences of events, while "Name" has a value associated with it which is
44// used to form a histogram.
45
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000046// This enum is backed by Chromium's histograms.xml,
47// chromium/src/tools/metrics/histograms/histograms.xml
48// Existing values cannot be re-ordered and new enums must be added
49// before kBoundary.
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070050enum PeerConnectionAddressFamilyCounter {
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000051 kPeerConnection_IPv4,
52 kPeerConnection_IPv6,
53 kBestConnections_IPv4,
54 kBestConnections_IPv6,
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070055 kPeerConnectionAddressFamilyCounter_Max,
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000056};
57
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000058// TODO(guoweis): Keep previous name here until all references are renamed.
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070059#define kBoundary kPeerConnectionAddressFamilyCounter_Max
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000060
61// TODO(guoweis): Keep previous name here until all references are renamed.
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070062typedef PeerConnectionAddressFamilyCounter PeerConnectionUMAMetricsCounter;
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000063
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000064// This enum defines types for UMA samples, which will have a range.
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000065enum PeerConnectionMetricsName {
66 kNetworkInterfaces_IPv4, // Number of IPv4 interfaces.
67 kNetworkInterfaces_IPv6, // Number of IPv6 interfaces.
68 kTimeToConnect, // In milliseconds.
69 kLocalCandidates_IPv4, // Number of IPv4 local candidates.
70 kLocalCandidates_IPv6, // Number of IPv6 local candidates.
71 kPeerConnectionMetricsName_Max
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000072};
73
guoweis@webrtc.org7169afd2014-12-04 17:59:29 +000074// TODO(guoweis): Keep previous name here until all references are renamed.
75typedef PeerConnectionMetricsName PeerConnectionUMAMetricsName;
76
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070077// The IceCandidatePairType has the format of
78// <local_candidate_type>_<remote_candidate_type>. It is recorded based on the
79// type of candidate pair used when the PeerConnection first goes to a completed
80// state. When BUNDLE is enabled, only the first transport gets recorded.
81enum IceCandidatePairType {
Guo-wei Shieh3cc834a2015-09-04 15:52:14 -070082 // HostHost is deprecated. It was replaced with the set of types at the bottom
83 // to report private or public host IP address.
Guo-wei Shieh3d564c12015-08-19 16:51:15 -070084 kIceCandidatePairHostHost,
85 kIceCandidatePairHostSrflx,
86 kIceCandidatePairHostRelay,
87 kIceCandidatePairHostPrflx,
88 kIceCandidatePairSrflxHost,
89 kIceCandidatePairSrflxSrflx,
90 kIceCandidatePairSrflxRelay,
91 kIceCandidatePairSrflxPrflx,
92 kIceCandidatePairRelayHost,
93 kIceCandidatePairRelaySrflx,
94 kIceCandidatePairRelayRelay,
95 kIceCandidatePairRelayPrflx,
96 kIceCandidatePairPrflxHost,
97 kIceCandidatePairPrflxSrflx,
98 kIceCandidatePairPrflxRelay,
Guo-wei Shieh3cc834a2015-09-04 15:52:14 -070099
100 // The following 4 types tell whether local and remote hosts have private or
101 // public IP addresses.
102 kIceCandidatePairHostPrivateHostPrivate,
103 kIceCandidatePairHostPrivateHostPublic,
104 kIceCandidatePairHostPublicHostPrivate,
105 kIceCandidatePairHostPublicHostPublic,
Guo-wei Shieh3d564c12015-08-19 16:51:15 -0700106 kIceCandidatePairMax
107};
108
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +0000109} // namespace webrtc
110
Henrik Kjellander15583c12016-02-10 10:53:12 +0100111#endif // WEBRTC_API_UMAMETRICS_H_