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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java

Issue 2555693003: Instant Apps: Split latency recordings into two. (Closed)
Patch Set: Created 4 years 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/instantapps/InstantAppsHandler.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java
index 97775eb96778f38042f95fa7e62ec8dabed77a18..c12128f0ba9e76103cca43a2916d48624fb3fc1f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java
@@ -77,6 +77,20 @@ public class InstantAppsHandler {
private static final TimesHistogramSample sInstantAppsApiCallTimes = new TimesHistogramSample(
"Android.InstantApps.ApiCallDuration2", TimeUnit.MILLISECONDS);
+ /**
+ * A histogram to record how long the GMS Core API call took when the instant app was found.
+ */
+ private static final TimesHistogramSample sInstantAppsApiCallTimesHasApp =
+ new TimesHistogramSample("Android.InstantApps.ApiCallDurationWithApp",
+ TimeUnit.MILLISECONDS);
+
+ /**
+ * A histogram to record how long the GMS Core API call took when the instant app was not found.
+ */
+ private static final TimesHistogramSample sInstantAppsApiCallTimesNoApp =
+ new TimesHistogramSample("Android.InstantApps.ApiCallDurationWithoutApp",
+ TimeUnit.MILLISECONDS);
+
/** @return The singleton instance of {@link InstantAppsHandler}. */
public static InstantAppsHandler getInstance() {
synchronized (INSTANCE_LOCK) {
@@ -121,6 +135,19 @@ public class InstantAppsHandler {
}
/**
+ * Record the amount of time spent in the Instant Apps API call.
+ * @param startTime The time at which we started doing computations.
+ * @param hasApp Whether the API has found an Instant App during the call.
+ */
+ protected void recordInstantAppsApiCallTime(long startTime, boolean hasApp) {
+ if (hasApp) {
+ sInstantAppsApiCallTimesHasApp.record(SystemClock.elapsedRealtime() - startTime);
+ } else {
+ sInstantAppsApiCallTimesNoApp.record(SystemClock.elapsedRealtime() - startTime);
+ }
+ }
+
+ /**
* In the case Chrome is called through the fallback mechanism from Instant Apps, record the
* amount of time the whole trip took.
* @param intent The current intent.
« 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