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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java

Issue 1736203002: [Contextual Search] Add metrics for Resolve and View timing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switched to using a separate timer. Created 4 years, 10 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
Index: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java
index f10f973bee79645bda12d96c1c4437adab6456c4..9190a45197963a8f3f6c53b6cc3dd24f11c435a7 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java
@@ -706,6 +706,28 @@ public class ContextualSearchUma {
}
/**
+ * Logs the duration from starting a search until the Search Term is resolved.
+ * @param durationMs The duration to record.
+ */
+ public static void logSearchTermResolutionDuration(long durationMs) {
+ RecordHistogram.recordMediumTimesHistogram(
+ "Search.ContextualSearchResolutionDuration", durationMs, TimeUnit.MILLISECONDS);
+ }
+
+ /**
+ * Logs the duration from starting a prefetched search until the panel navigates to the results
+ * and they start becoming viewable. Should be called only for searches that are prefetched.
+ * @param durationMs The duration to record.
+ * @param didResolve Whether a Search Term resolution was required as part of the loading.
+ */
+ public static void logPrefetchedSearchNavigatedDuration(long durationMs, boolean didResolve) {
+ String histogramName = didResolve ? "Search.ContextualSearchResolvedSearchDuration"
+ : "Search.ContextualSearchLiteralSearchDuration";
+ RecordHistogram.recordMediumTimesHistogram(
+ histogramName, durationMs, TimeUnit.MILLISECONDS);
+ }
+
+ /**
* Logs whether the promo was seen.
* Logs multiple histograms, with and without the original triggering gesture.
* @param wasPanelSeen Whether the panel was seen.

Powered by Google App Engine
This is Rietveld 408576698