Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1141)

Side by Side Diff: content/renderer/media/rtc_peer_connection_handler.cc

Issue 1335023002: Add UMA metrics and finch experiment for DTLS1.2 in WebRTC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/rtc_peer_connection_handler.h" 5 #include "content/renderer/media/rtc_peer_connection_handler.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/lazy_instance.h" 12 #include "base/lazy_instance.h"
13 #include "base/location.h" 13 #include "base/location.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/metrics/histogram.h" 16 #include "base/metrics/histogram.h"
17 #include "base/metrics/sparse_histogram.h"
17 #include "base/stl_util.h" 18 #include "base/stl_util.h"
18 #include "base/strings/utf_string_conversions.h" 19 #include "base/strings/utf_string_conversions.h"
19 #include "base/thread_task_runner_handle.h" 20 #include "base/thread_task_runner_handle.h"
20 #include "base/trace_event/trace_event.h" 21 #include "base/trace_event/trace_event.h"
21 #include "content/public/common/content_switches.h" 22 #include "content/public/common/content_switches.h"
22 #include "content/renderer/media/media_stream_track.h" 23 #include "content/renderer/media/media_stream_track.h"
23 #include "content/renderer/media/peer_connection_tracker.h" 24 #include "content/renderer/media/peer_connection_tracker.h"
24 #include "content/renderer/media/remote_media_stream_impl.h" 25 #include "content/renderer/media/remote_media_stream_impl.h"
25 #include "content/renderer/media/rtc_data_channel_handler.h" 26 #include "content/renderer/media/rtc_data_channel_handler.h"
26 #include "content/renderer/media/rtc_dtmf_sender_handler.h" 27 #include "content/renderer/media/rtc_dtmf_sender_handler.h"
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 UMA_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.CandidatePairType_TCP", 545 UMA_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.CandidatePairType_TCP",
545 counter, counter_max); 546 counter, counter_max);
546 break; 547 break;
547 default: 548 default:
548 // The default clause is expected to reach when new enum types are 549 // The default clause is expected to reach when new enum types are
549 // added. 550 // added.
550 break; 551 break;
551 } 552 }
552 } 553 }
553 554
555 void IncrementSparseEnumCounter(
556 webrtc::PeerConnectionEnumCounterType counter_type,
557 int counter) override {
558 switch (counter_type) {
559 case webrtc::kEnumCounterAudioSrtpCipher:
560 UMA_HISTOGRAM_SPARSE_SLOWLY(
561 "WebRTC.PeerConnection.SrtpCryptoSuite.Audio", counter);
562 break;
563 case webrtc::kEnumCounterAudioSslCipher:
564 UMA_HISTOGRAM_SPARSE_SLOWLY(
565 "WebRTC.PeerConnection.SslCipherSuite.Audio", counter);
566 break;
567 case webrtc::kEnumCounterVideoSrtpCipher:
568 UMA_HISTOGRAM_SPARSE_SLOWLY(
569 "WebRTC.PeerConnection.SrtpCryptoSuite.Video", counter);
570 break;
571 case webrtc::kEnumCounterVideoSslCipher:
572 UMA_HISTOGRAM_SPARSE_SLOWLY(
573 "WebRTC.PeerConnection.SslCipherSuite.Video", counter);
574 break;
575 case webrtc::kEnumCounterDataSrtpCipher:
576 UMA_HISTOGRAM_SPARSE_SLOWLY(
577 "WebRTC.PeerConnection.SrtpCryptoSuite.Data", counter);
578 break;
579 case webrtc::kEnumCounterDataSslCipher:
580 UMA_HISTOGRAM_SPARSE_SLOWLY(
581 "WebRTC.PeerConnection.SslCipherSuite.Data", counter);
582 break;
583 default:
584 // The default clause is expected to reach when new enum types are
585 // added.
586 break;
587 }
588 }
589
554 void AddHistogramSample(webrtc::PeerConnectionUMAMetricsName type, 590 void AddHistogramSample(webrtc::PeerConnectionUMAMetricsName type,
555 int value) override { 591 int value) override {
556 // Runs on libjingle's signaling thread. 592 // Runs on libjingle's signaling thread.
557 switch (type) { 593 switch (type) {
558 case webrtc::kTimeToConnect: 594 case webrtc::kTimeToConnect:
559 UMA_HISTOGRAM_MEDIUM_TIMES( 595 UMA_HISTOGRAM_MEDIUM_TIMES(
560 "WebRTC.PeerConnection.TimeToConnect", 596 "WebRTC.PeerConnection.TimeToConnect",
561 base::TimeDelta::FromMilliseconds(value)); 597 base::TimeDelta::FromMilliseconds(value));
562 break; 598 break;
563 case webrtc::kNetworkInterfaces_IPv4: 599 case webrtc::kNetworkInterfaces_IPv4:
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after
1627 } 1663 }
1628 1664
1629 void RTCPeerConnectionHandler::ResetUMAStats() { 1665 void RTCPeerConnectionHandler::ResetUMAStats() {
1630 DCHECK(thread_checker_.CalledOnValidThread()); 1666 DCHECK(thread_checker_.CalledOnValidThread());
1631 num_local_candidates_ipv6_ = 0; 1667 num_local_candidates_ipv6_ = 0;
1632 num_local_candidates_ipv4_ = 0; 1668 num_local_candidates_ipv4_ = 0;
1633 ice_connection_checking_start_ = base::TimeTicks(); 1669 ice_connection_checking_start_ = base::TimeTicks();
1634 memset(ice_state_seen_, 0, sizeof(ice_state_seen_)); 1670 memset(ice_state_seen_, 0, sizeof(ice_state_seen_));
1635 } 1671 }
1636 } // namespace content 1672 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698