buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 1 | /* |
kjellander | b24317b | 2016-02-10 07:54:43 -0800 | [diff] [blame^] | 2 | * Copyright 2014 The WebRTC project authors. All Rights Reserved. |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 3 | * |
kjellander | b24317b | 2016-02-10 07:54:43 -0800 | [diff] [blame^] | 4 | * 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.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | // This file contains enums related to IPv4/IPv6 metrics. |
| 12 | |
Henrik Kjellander | 15583c1 | 2016-02-10 10:53:12 +0100 | [diff] [blame] | 13 | #ifndef WEBRTC_API_UMAMETRICS_H_ |
| 14 | #define WEBRTC_API_UMAMETRICS_H_ |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 15 | |
| 16 | namespace webrtc { |
| 17 | |
Guo-wei Shieh | 3d564c1 | 2015-08-19 16:51:15 -0700 | [diff] [blame] | 18 | // Used to specify which enum counter type we're incrementing in |
| 19 | // MetricsObserverInterface::IncrementEnumCounter. |
| 20 | enum 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 Shieh | 456696a | 2015-09-30 21:48:54 -0700 | [diff] [blame] | 28 | |
| 29 | kEnumCounterAudioSrtpCipher, |
| 30 | kEnumCounterAudioSslCipher, |
| 31 | kEnumCounterVideoSrtpCipher, |
| 32 | kEnumCounterVideoSslCipher, |
| 33 | kEnumCounterDataSrtpCipher, |
| 34 | kEnumCounterDataSslCipher, |
Guo-wei Shieh | 3d564c1 | 2015-08-19 16:51:15 -0700 | [diff] [blame] | 35 | kPeerConnectionEnumCounterMax |
| 36 | }; |
| 37 | |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 38 | // Currently this contains information related to WebRTC network/transport |
| 39 | // information. |
| 40 | |
Guo-wei Shieh | 3d564c1 | 2015-08-19 16:51:15 -0700 | [diff] [blame] | 41 | // The difference between PeerConnectionEnumCounter and |
| 42 | // PeerConnectionMetricsName is that the "EnumCounter" is only counting the |
guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 +0000 | [diff] [blame] | 43 | // occurrences of events, while "Name" has a value associated with it which is |
| 44 | // used to form a histogram. |
| 45 | |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 46 | // 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 Shieh | 3d564c1 | 2015-08-19 16:51:15 -0700 | [diff] [blame] | 50 | enum PeerConnectionAddressFamilyCounter { |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 51 | kPeerConnection_IPv4, |
| 52 | kPeerConnection_IPv6, |
| 53 | kBestConnections_IPv4, |
| 54 | kBestConnections_IPv6, |
Guo-wei Shieh | 3d564c1 | 2015-08-19 16:51:15 -0700 | [diff] [blame] | 55 | kPeerConnectionAddressFamilyCounter_Max, |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 56 | }; |
| 57 | |
guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 +0000 | [diff] [blame] | 58 | // TODO(guoweis): Keep previous name here until all references are renamed. |
Guo-wei Shieh | 3d564c1 | 2015-08-19 16:51:15 -0700 | [diff] [blame] | 59 | #define kBoundary kPeerConnectionAddressFamilyCounter_Max |
guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 +0000 | [diff] [blame] | 60 | |
| 61 | // TODO(guoweis): Keep previous name here until all references are renamed. |
Guo-wei Shieh | 3d564c1 | 2015-08-19 16:51:15 -0700 | [diff] [blame] | 62 | typedef PeerConnectionAddressFamilyCounter PeerConnectionUMAMetricsCounter; |
guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 +0000 | [diff] [blame] | 63 | |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 64 | // This enum defines types for UMA samples, which will have a range. |
guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 +0000 | [diff] [blame] | 65 | enum 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.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 72 | }; |
| 73 | |
guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 +0000 | [diff] [blame] | 74 | // TODO(guoweis): Keep previous name here until all references are renamed. |
| 75 | typedef PeerConnectionMetricsName PeerConnectionUMAMetricsName; |
| 76 | |
Guo-wei Shieh | 3d564c1 | 2015-08-19 16:51:15 -0700 | [diff] [blame] | 77 | // 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. |
| 81 | enum IceCandidatePairType { |
Guo-wei Shieh | 3cc834a | 2015-09-04 15:52:14 -0700 | [diff] [blame] | 82 | // 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 Shieh | 3d564c1 | 2015-08-19 16:51:15 -0700 | [diff] [blame] | 84 | 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 Shieh | 3cc834a | 2015-09-04 15:52:14 -0700 | [diff] [blame] | 99 | |
| 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 Shieh | 3d564c1 | 2015-08-19 16:51:15 -0700 | [diff] [blame] | 106 | kIceCandidatePairMax |
| 107 | }; |
| 108 | |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 109 | } // namespace webrtc |
| 110 | |
Henrik Kjellander | 15583c1 | 2016-02-10 10:53:12 +0100 | [diff] [blame] | 111 | #endif // WEBRTC_API_UMAMETRICS_H_ |