| 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.
|
|
|