diff options
author | derekjchow <derekjchow@chromium.org> | 2014-12-22 16:38:16 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-23 00:39:22 +0000 |
commit | 0b1cb7b3abf1a823358b3b203d711d0b2d2e8713 (patch) | |
tree | 3443e482fb4bff752ab6d5602fa12100f7eebbe9 /chromecast/base | |
parent | 429bbdd261e1530b951ba528081343d2c9947408 (diff) | |
download | chromium_src-0b1cb7b3abf1a823358b3b203d711d0b2d2e8713.zip chromium_src-0b1cb7b3abf1a823358b3b203d711d0b2d2e8713.tar.gz chromium_src-0b1cb7b3abf1a823358b3b203d711d0b2d2e8713.tar.bz2 |
Add time to first paint metric to CastMetricsHelper.
New metrics to record when cast_shell makes an initial paint for a
webpage.
R=gunsch@chromium.org
BUG=
Review URL: https://codereview.chromium.org/819213002
Cr-Commit-Position: refs/heads/master@{#309503}
Diffstat (limited to 'chromecast/base')
-rw-r--r-- | chromecast/base/metrics/cast_metrics_helper.cc | 9 | ||||
-rw-r--r-- | chromecast/base/metrics/cast_metrics_helper.h | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/chromecast/base/metrics/cast_metrics_helper.cc b/chromecast/base/metrics/cast_metrics_helper.cc index 8ac2fe6..35188bc 100644 --- a/chromecast/base/metrics/cast_metrics_helper.cc +++ b/chromecast/base/metrics/cast_metrics_helper.cc @@ -151,6 +151,15 @@ void CastMetricsHelper::LogMediaPause() { sdk_version_)); } +void CastMetricsHelper::LogTimeToFirstPaint() { + MAKE_SURE_THREAD(LogTimeToFirstPaint); + base::TimeDelta launch_time = base::TimeTicks::Now() - app_start_time_; + const std::string uma_name(GetMetricsNameWithAppName("Startup", + "TimeToFirstPaint")); + LogMediumTimeHistogramEvent(uma_name, launch_time); + LOG(INFO) << uma_name << " is " << launch_time.InSecondsF() << " seconds."; +} + void CastMetricsHelper::LogTimeToDisplayVideo() { if (!new_startup_time_) { // For faster check. return; diff --git a/chromecast/base/metrics/cast_metrics_helper.h b/chromecast/base/metrics/cast_metrics_helper.h index fb22ff8..5dbba7c 100644 --- a/chromecast/base/metrics/cast_metrics_helper.h +++ b/chromecast/base/metrics/cast_metrics_helper.h @@ -76,6 +76,9 @@ class CastMetricsHelper { // This is used as an in-place replacement of content::RecordComputedAction(). virtual void RecordSimpleAction(const std::string& action); + // Logs UMA record of the time the app made its first paint. + virtual void LogTimeToFirstPaint(); + // Logs UMA record of the elapsed time from the app launch // to the time first video frame is displayed. virtual void LogTimeToDisplayVideo(); |