Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.contextualsearch; | 5 package org.chromium.chrome.browser.contextualsearch; |
| 6 | 6 |
| 7 import android.util.Pair; | 7 import android.util.Pair; |
| 8 | 8 |
| 9 import org.chromium.base.metrics.RecordHistogram; | 9 import org.chromium.base.metrics.RecordHistogram; |
| 10 import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.PanelState; | 10 import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.PanelState; |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 699 } | 699 } |
| 700 | 700 |
| 701 // Also record a summary histogram with counts for each possibility. | 701 // Also record a summary histogram with counts for each possibility. |
| 702 int code = !wasPrefetch ? NOT_PREFETCHED | 702 int code = !wasPrefetch ? NOT_PREFETCHED |
| 703 : (durationMs == 0 ? PREFETCHED_FULLY_LOADED : PREFETCHED_PARIAL LY_LOADED); | 703 : (durationMs == 0 ? PREFETCHED_FULLY_LOADED : PREFETCHED_PARIAL LY_LOADED); |
| 704 RecordHistogram.recordEnumeratedHistogram("Search.ContextualSearchPrefet chSummary", | 704 RecordHistogram.recordEnumeratedHistogram("Search.ContextualSearchPrefet chSummary", |
| 705 code, PREFETCH_BOUNDARY); | 705 code, PREFETCH_BOUNDARY); |
| 706 } | 706 } |
| 707 | 707 |
| 708 /** | 708 /** |
| 709 * Logs the duration from starting a search until the Search Term is Resolve d. | |
| 710 * @param durationMs The duration to record. | |
| 711 */ | |
| 712 public static void logSearchTermResolution(long durationMs) { | |
|
pedro (no code reviews)
2016/02/26 22:30:09
Nit: logSearchTermResolution --> logSearchTermReso
Donn Denman
2016/02/27 00:18:40
Done.
| |
| 713 RecordHistogram.recordMediumTimesHistogram( | |
| 714 "Search.ContextualSearchResolutionDuration", durationMs, TimeUni t.MILLISECONDS); | |
| 715 } | |
| 716 | |
| 717 /** | |
| 718 * Logs the duration from starting a search until the results in the SERP st art to become | |
| 719 * viewable. Should be called only for searches that are prefetched. | |
| 720 * @param durationMs The duration to record. | |
| 721 * @param didResolve Whether a Search Term Resolution was required as part o f the loading. | |
| 722 */ | |
| 723 public static void logSearchResultsViewable(long durationMs, boolean didReso lve) { | |
| 724 String histogramName = didResolve ? "Search.ContextualSearchResolvedResu ltsViewableDuration" | |
| 725 : "Search.ContextualSearchLiteralResul tsViewableDuration"; | |
|
pedro (no code reviews)
2016/02/26 22:30:10
I thought "literal" / verbatim results were never
Donn Denman
2016/02/27 00:18:39
No, with the opt-out on HTTPS pages we usually do
pedro (no code reviews)
2016/02/27 00:39:04
I see. In this case, nevermind.
| |
| 726 RecordHistogram.recordMediumTimesHistogram( | |
| 727 histogramName, durationMs, TimeUnit.MILLISECONDS); | |
| 728 } | |
| 729 | |
| 730 /** | |
| 709 * Logs whether the promo was seen. | 731 * Logs whether the promo was seen. |
|
pedro (no code reviews)
2016/02/26 22:30:09
Shouldn't we also log the time it takes to establi
Donn Denman
2016/02/27 00:18:39
Are you asking about the initial selection that ha
pedro (no code reviews)
2016/02/27 00:39:04
Yes, I'm asking about the initial selection. I tho
Donn Denman
2016/02/29 17:54:11
The idea of not establishing an initial selection
| |
| 710 * Logs multiple histograms, with and without the original triggering gestur e. | 732 * Logs multiple histograms, with and without the original triggering gestur e. |
| 711 * @param wasPanelSeen Whether the panel was seen. | 733 * @param wasPanelSeen Whether the panel was seen. |
| 712 * @param wasTap Whether the gesture that originally caused the panel to sho w was a Tap. | 734 * @param wasTap Whether the gesture that originally caused the panel to sho w was a Tap. |
| 713 */ | 735 */ |
| 714 public static void logPromoSeen(boolean wasPanelSeen, boolean wasTap) { | 736 public static void logPromoSeen(boolean wasPanelSeen, boolean wasTap) { |
| 715 RecordHistogram.recordEnumeratedHistogram("Search.ContextualSearchFirstR unPanelSeen", | 737 RecordHistogram.recordEnumeratedHistogram("Search.ContextualSearchFirstR unPanelSeen", |
| 716 wasPanelSeen ? RESULTS_SEEN : RESULTS_NOT_SEEN, RESULTS_SEEN_BOU NDARY); | 738 wasPanelSeen ? RESULTS_SEEN : RESULTS_NOT_SEEN, RESULTS_SEEN_BOU NDARY); |
| 717 logHistogramByGesture(wasPanelSeen, wasTap, "Search.ContextualSearchProm oSeenByGesture"); | 739 logHistogramByGesture(wasPanelSeen, wasTap, "Search.ContextualSearchProm oSeenByGesture"); |
| 718 } | 740 } |
| 719 | 741 |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 945 * @param wasTap Whether the gesture that originally caused the panel to sho w was a Tap. | 967 * @param wasTap Whether the gesture that originally caused the panel to sho w was a Tap. |
| 946 * @param histogramName The full name of the histogram to log to. | 968 * @param histogramName The full name of the histogram to log to. |
| 947 */ | 969 */ |
| 948 private static void logHistogramByGesture(boolean wasPanelSeen, boolean wasT ap, | 970 private static void logHistogramByGesture(boolean wasPanelSeen, boolean wasT ap, |
| 949 String histogramName) { | 971 String histogramName) { |
| 950 RecordHistogram.recordEnumeratedHistogram(histogramName, | 972 RecordHistogram.recordEnumeratedHistogram(histogramName, |
| 951 getPanelSeenByGestureStateCode(wasPanelSeen, wasTap), | 973 getPanelSeenByGestureStateCode(wasPanelSeen, wasTap), |
| 952 RESULTS_BY_GESTURE_BOUNDARY); | 974 RESULTS_BY_GESTURE_BOUNDARY); |
| 953 } | 975 } |
| 954 } | 976 } |
| OLD | NEW |