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

Side by Side Diff: chromecast/base/metrics/cast_metrics_helper.cc

Issue 972393002: [Chromecast] Don't log time to first paint if no app has been set. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chromecast/base/metrics/cast_metrics_helper.h" 5 #include "chromecast/base/metrics/cast_metrics_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 MAKE_SURE_THREAD(LogMediaPause); 142 MAKE_SURE_THREAD(LogMediaPause);
143 RecordSimpleAction(EncodeAppInfoIntoMetricsName( 143 RecordSimpleAction(EncodeAppInfoIntoMetricsName(
144 "MediaPause", 144 "MediaPause",
145 app_id_, 145 app_id_,
146 session_id_, 146 session_id_,
147 sdk_version_)); 147 sdk_version_));
148 } 148 }
149 149
150 void CastMetricsHelper::LogTimeToFirstPaint() { 150 void CastMetricsHelper::LogTimeToFirstPaint() {
151 MAKE_SURE_THREAD(LogTimeToFirstPaint); 151 MAKE_SURE_THREAD(LogTimeToFirstPaint);
152 if (app_id_.empty())
153 return;
152 base::TimeDelta launch_time = base::TimeTicks::Now() - app_start_time_; 154 base::TimeDelta launch_time = base::TimeTicks::Now() - app_start_time_;
153 const std::string uma_name(GetMetricsNameWithAppName("Startup", 155 const std::string uma_name(GetMetricsNameWithAppName("Startup",
154 "TimeToFirstPaint")); 156 "TimeToFirstPaint"));
155 LogMediumTimeHistogramEvent(uma_name, launch_time); 157 LogMediumTimeHistogramEvent(uma_name, launch_time);
156 LOG(INFO) << uma_name << " is " << launch_time.InSecondsF() << " seconds."; 158 LOG(INFO) << uma_name << " is " << launch_time.InSecondsF() << " seconds.";
157 } 159 }
158 160
159 void CastMetricsHelper::LogTimeToDisplayVideo() { 161 void CastMetricsHelper::LogTimeToDisplayVideo() {
160 if (!new_startup_time_) { // For faster check. 162 if (!new_startup_time_) { // For faster check.
161 return; 163 return;
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 const base::TimeDelta& value) { 317 const base::TimeDelta& value) {
316 // Follow UMA_HISTOGRAM_MEDIUM_TIMES definition. 318 // Follow UMA_HISTOGRAM_MEDIUM_TIMES definition.
317 LogTimeHistogramEvent(name, value, 319 LogTimeHistogramEvent(name, value,
318 base::TimeDelta::FromMilliseconds(10), 320 base::TimeDelta::FromMilliseconds(10),
319 base::TimeDelta::FromMinutes(3), 321 base::TimeDelta::FromMinutes(3),
320 50); 322 50);
321 } 323 }
322 324
323 } // namespace metrics 325 } // namespace metrics
324 } // namespace chromecast 326 } // namespace chromecast
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698