OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 // This file contains enums related to IPv4/IPv6 metrics. | 11 // This file contains enums related to IPv4/IPv6 metrics. |
12 | 12 |
13 #ifndef WEBRTC_API_UMAMETRICS_H_ | 13 #ifndef WEBRTC_API_UMAMETRICS_H_ |
14 #define WEBRTC_API_UMAMETRICS_H_ | 14 #define WEBRTC_API_UMAMETRICS_H_ |
15 | 15 |
| 16 #include "webrtc/base/refcount.h" |
| 17 |
16 namespace webrtc { | 18 namespace webrtc { |
17 | 19 |
18 // Used to specify which enum counter type we're incrementing in | 20 // Used to specify which enum counter type we're incrementing in |
19 // MetricsObserverInterface::IncrementEnumCounter. | 21 // MetricsObserverInterface::IncrementEnumCounter. |
20 enum PeerConnectionEnumCounterType { | 22 enum PeerConnectionEnumCounterType { |
21 kEnumCounterAddressFamily, | 23 kEnumCounterAddressFamily, |
22 // For the next 2 counters, we track them separately based on the "first hop" | 24 // 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 | 25 // 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 | 26 // 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. | 27 // to the TURN server in the case of TURN candidates. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 104 |
103 // The following 4 types tell whether local and remote hosts have private or | 105 // The following 4 types tell whether local and remote hosts have private or |
104 // public IP addresses. | 106 // public IP addresses. |
105 kIceCandidatePairHostPrivateHostPrivate, | 107 kIceCandidatePairHostPrivateHostPrivate, |
106 kIceCandidatePairHostPrivateHostPublic, | 108 kIceCandidatePairHostPrivateHostPublic, |
107 kIceCandidatePairHostPublicHostPrivate, | 109 kIceCandidatePairHostPublicHostPrivate, |
108 kIceCandidatePairHostPublicHostPublic, | 110 kIceCandidatePairHostPublicHostPublic, |
109 kIceCandidatePairMax | 111 kIceCandidatePairMax |
110 }; | 112 }; |
111 | 113 |
| 114 class MetricsObserverInterface : public rtc::RefCountInterface { |
| 115 public: |
| 116 |
| 117 // |type| is the type of the enum counter to be incremented. |counter| |
| 118 // is the particular counter in that type. |counter_max| is the next sequence |
| 119 // number after the highest counter. |
| 120 virtual void IncrementEnumCounter(PeerConnectionEnumCounterType type, |
| 121 int counter, |
| 122 int counter_max) {} |
| 123 |
| 124 // This is used to handle sparse counters like SSL cipher suites. |
| 125 // TODO(guoweis): Remove the implementation once the dependency's interface |
| 126 // definition is updated. |
| 127 virtual void IncrementSparseEnumCounter(PeerConnectionEnumCounterType type, |
| 128 int counter) { |
| 129 IncrementEnumCounter(type, counter, 0 /* Ignored */); |
| 130 } |
| 131 |
| 132 virtual void AddHistogramSample(PeerConnectionMetricsName type, |
| 133 int value) = 0; |
| 134 |
| 135 protected: |
| 136 virtual ~MetricsObserverInterface() {} |
| 137 }; |
| 138 |
| 139 typedef MetricsObserverInterface UMAObserver; |
| 140 |
112 } // namespace webrtc | 141 } // namespace webrtc |
113 | 142 |
114 #endif // WEBRTC_API_UMAMETRICS_H_ | 143 #endif // WEBRTC_API_UMAMETRICS_H_ |
OLD | NEW |