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

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

Issue 427713004: Add histogram WebRTC.UserMediaRequest.Events to allow to track getUserMedia failures and hangs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/webrtc_uma_histograms.h" 5 #include "content/renderer/media/webrtc_uma_histograms.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 8
9 namespace content { 9 namespace content {
10 10
11 void LogUserMediaRequestEvent(UserMediaRequestEvent event) {
12 UMA_HISTOGRAM_ENUMERATION(
13 "WebRTC.UserMediaRequest.Event", event, NUM_USERMEDIAREQUEST_EVENTS);
14 }
15
16 void LogUserMediaRequestResult(MediaStreamRequestResult result) {
17 LogUserMediaRequestEvent(
18 static_cast<UserMediaRequestEvent>(USERMEDIAREQUEST_RESULT + result));
19 }
20
11 void UpdateWebRTCMethodCount(JavaScriptAPIName api_name) { 21 void UpdateWebRTCMethodCount(JavaScriptAPIName api_name) {
12 DVLOG(3) << "Incrementing WebRTC.webkitApiCount for " << api_name; 22 DVLOG(3) << "Incrementing WebRTC.webkitApiCount for " << api_name;
13 UMA_HISTOGRAM_ENUMERATION("WebRTC.webkitApiCount", api_name, INVALID_NAME); 23 UMA_HISTOGRAM_ENUMERATION("WebRTC.webkitApiCount", api_name, INVALID_NAME);
14 PerSessionWebRTCAPIMetrics::GetInstance()->LogUsageOnlyOnce(api_name); 24 PerSessionWebRTCAPIMetrics::GetInstance()->LogUsageOnlyOnce(api_name);
15 } 25 }
16 26
17 PerSessionWebRTCAPIMetrics::~PerSessionWebRTCAPIMetrics() { 27 PerSessionWebRTCAPIMetrics::~PerSessionWebRTCAPIMetrics() {
18 } 28 }
19 29
20 // static 30 // static
(...skipping 30 matching lines...) Expand all
51 LogUsage(api_name); 61 LogUsage(api_name);
52 } 62 }
53 } 63 }
54 64
55 void PerSessionWebRTCAPIMetrics::ResetUsage() { 65 void PerSessionWebRTCAPIMetrics::ResetUsage() {
56 for (size_t i = 0; i < arraysize(has_used_api_); ++i) 66 for (size_t i = 0; i < arraysize(has_used_api_); ++i)
57 has_used_api_[i] = false; 67 has_used_api_[i] = false;
58 } 68 }
59 69
60 } // namespace content 70 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698