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

Unified Diff: content/renderer/media/webrtc_uma_histograms.cc

Issue 446553002: Add histogram WebRTC.UserMediaRequest.NoResultState to track user media requests with no result. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b399835
Patch Set: Diffbase https://codereview.chromium.org/427713004/ 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/webrtc_uma_histograms.cc
diff --git a/content/renderer/media/webrtc_uma_histograms.cc b/content/renderer/media/webrtc_uma_histograms.cc
index 6dc50a397c8e7f222128d2393f3cc73f7a900254..aff7a0cb602d5b27f13f7e188668a3a35966e1c2 100644
--- a/content/renderer/media/webrtc_uma_histograms.cc
+++ b/content/renderer/media/webrtc_uma_histograms.cc
@@ -8,6 +8,30 @@
namespace content {
+void LogUserMediaRequestWithNoResult(bool request_cancelled,
+ bool stream_generated,
+ bool pending_sources) {
+ enum {
Mark P 2014/08/05 18:50:23 Please explicitly state that elements in this enum
vrk (LEFT CHROMIUM) 2014/08/05 19:05:41 Move this enum to content/public/common/media_stre
andresp-chromium 2014/08/06 10:13:56 Done.
andresp-chromium 2014/08/06 10:13:56 Done. But moved the enum into webrtc_uma_histogram
+ USER_MEDIA_REQUEST_CANCELLED,
Mark P 2014/08/05 18:50:23 Please explicitly use = 0, = 1, etc.
andresp-chromium 2014/08/06 10:13:56 Done.
+ USER_MEDIA_REQUEST_NOT_GENERATED,
+ USER_MEDIA_REQUEST_PENDING_MEDIA_TRACKS,
+ NUM_USER_MEDIA_REQUEST_WITH_NO_RESULT
+ };
+
+ // If a stream has been generated then there must be pending sources otherwise
+ // there would have been a result. Additionally there can't be pending sources
+ // before it gets generated.
+ DCHECK(stream_generated ? pending_sources : !pending_sources);
vrk (LEFT CHROMIUM) 2014/08/05 19:05:41 FYI, could have done DCHECK_EQ(stream_generated, p
andresp-chromium 2014/08/06 10:13:56 Acknowledged.
+
+ UMA_HISTOGRAM_ENUMERATION(
+ "WebRTC.UserMediaRequest.NoResultState",
+ request_cancelled
+ ? USER_MEDIA_REQUEST_CANCELLED
+ : (!stream_generated ? USER_MEDIA_REQUEST_NOT_GENERATED
+ : USER_MEDIA_REQUEST_PENDING_MEDIA_TRACKS),
+ NUM_USER_MEDIA_REQUEST_WITH_NO_RESULT);
+}
+
void LogUserMediaRequestResult(MediaStreamRequestResult result) {
UMA_HISTOGRAM_ENUMERATION(
"WebRTC.UserMediaRequest.Result", result, NUM_MEDIA_REQUEST_RESULTS);

Powered by Google App Engine
This is Rietveld 408576698