Changed enums to less generic names.

IPv4/IPv6 will be sent when RegisterUMAObserver is called. This is done
as Initialize is not called through interface.

R=jiayl@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/14469006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6112 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mallinath@webrtc.org 2014-05-12 23:10:18 +00:00
parent 72885d1c91
commit d37bcfa882
3 changed files with 15 additions and 6 deletions

View File

@ -622,6 +622,14 @@ bool PeerConnection::AddIceCandidate(
void PeerConnection::RegisterUMAObserver(UMAObserver* observer) {
uma_observer_ = observer;
// Send information about IPv4/IPv6 status.
if (uma_observer_ && port_allocator_) {
if (port_allocator_->flags() & cricket::PORTALLOCATOR_ENABLE_IPV6) {
uma_observer_->IncrementCounter(kPeerConnection_IPv4);
} else {
uma_observer_->IncrementCounter(kPeerConnection_IPv6);
}
}
}
const SessionDescriptionInterface* PeerConnection::local_description() const {

View File

@ -121,8 +121,9 @@ class StatsObserver : public talk_base::RefCountInterface {
class UMAObserver : public talk_base::RefCountInterface {
public:
virtual void IncrementCounter(UMAMetricsCounter type) = 0;
virtual void AddHistogramSample(UMAMetricsName type, int value) = 0;
virtual void IncrementCounter(PeerConnectionUMAMetricsCounter type) = 0;
virtual void AddHistogramSample(PeerConnectionUMAMetricsName type,
int value) = 0;
protected:
virtual ~UMAObserver() {}

View File

@ -39,7 +39,7 @@ namespace webrtc {
// chromium/src/tools/metrics/histograms/histograms.xml
// Existing values cannot be re-ordered and new enums must be added
// before kBoundary.
enum UMAMetricsCounter {
enum PeerConnectionUMAMetricsCounter {
kPeerConnection_IPv4,
kPeerConnection_IPv6,
kBestConnections_IPv4,
@ -48,9 +48,9 @@ enum UMAMetricsCounter {
};
// This enum defines types for UMA samples, which will have a range.
enum UMAMetricsName {
kNetworkInterfaces_IPv4,
kNetworkInterfaces_IPv6,
enum PeerConnectionUMAMetricsName {
kNetworkInterfaces_IPv4, // Number of IPv4 interfaces.
kNetworkInterfaces_IPv6, // Number of IPv6 interfaces.
kTimeToConnect, // In milliseconds.
};