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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/LogoDelegateImpl.java

Issue 2763703002: [Doodle] Track the time to took for the Doodle to show up on the NTP (Closed)
Patch Set: review Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/LogoDelegateImpl.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/LogoDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/LogoDelegateImpl.java
index dcbefbb76a5c6f484ae16168a0794cad3678d895..d38337333bab4fe38381f1fccce40f6e2d2b6d16 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/LogoDelegateImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/LogoDelegateImpl.java
@@ -11,6 +11,8 @@ import org.chromium.chrome.browser.tab.Tab;
import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.ui.base.PageTransition;
+import java.util.concurrent.TimeUnit;
+
import jp.tomorrowkey.android.gifplayer.BaseGifImage;
/**
@@ -22,6 +24,8 @@ public class LogoDelegateImpl implements LogoView.Delegate {
private static final int STATIC_LOGO_SHOWN = 0;
private static final int CTA_IMAGE_SHOWN = 1;
+ private static final String LOGO_SHOWN_TIME_UMA_NAME = "NewTabPage.LogoShownTime";
Ilya Sherman 2017/03/21 21:01:54 Out of curiosity, what's the reason for defining t
Marc Treib 2017/03/21 22:10:32 Nothing in particular, just consistency with the o
+
private static final String LOGO_CLICK_UMA_NAME = "NewTabPage.LogoClick";
private static final int STATIC_LOGO_CLICKED = 0;
private static final int CTA_IMAGE_CLICKED = 1;
@@ -34,6 +38,8 @@ public class LogoDelegateImpl implements LogoView.Delegate {
private String mOnLogoClickUrl;
private String mAnimatedLogoUrl;
+ private boolean mHasRecordedLoadTime;
+
private boolean mIsDestroyed;
/**
@@ -77,6 +83,8 @@ public class LogoDelegateImpl implements LogoView.Delegate {
public void getSearchProviderLogo(final LogoObserver logoObserver) {
if (mIsDestroyed) return;
+ final long loadTimeStart = System.currentTimeMillis();
+
LogoObserver wrapperCallback = new LogoObserver() {
@Override
public void onLogoAvailable(Logo logo, boolean fromCache) {
@@ -86,6 +94,12 @@ public class LogoDelegateImpl implements LogoView.Delegate {
if (logo != null) {
RecordHistogram.recordSparseSlowlyHistogram(LOGO_SHOWN_UMA_NAME,
logo.animatedLogoUrl == null ? STATIC_LOGO_SHOWN : CTA_IMAGE_SHOWN);
+ if (!mHasRecordedLoadTime) {
+ long loadTime = System.currentTimeMillis() - loadTimeStart;
+ RecordHistogram.recordMediumTimesHistogram(
+ LOGO_SHOWN_TIME_UMA_NAME, loadTime, TimeUnit.MILLISECONDS);
+ mHasRecordedLoadTime = true;
+ }
}
logoObserver.onLogoAvailable(logo, fromCache);
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698