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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelMetrics.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: Updated some method names. 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 unified diff | Download patch
OLDNEW
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.compositor.bottombar.contextualsearch; 5 package org.chromium.chrome.browser.compositor.bottombar.contextualsearch;
6 6
7 import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.PanelState; 7 import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.PanelState;
8 import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.StateChange Reason; 8 import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.StateChange Reason;
9 import org.chromium.chrome.browser.contextualsearch.ContextualSearchUma; 9 import org.chromium.chrome.browser.contextualsearch.ContextualSearchUma;
10 10
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 assert mSearchViewStartTimeNs != 0; 181 assert mSearchViewStartTimeNs != 0;
182 long durationMs = (System.nanoTime() - mSearchViewStartTimeNs) / 100 0000; 182 long durationMs = (System.nanoTime() - mSearchViewStartTimeNs) / 100 0000;
183 logSearchPanelLoadDuration(wasPrefetch, durationMs); 183 logSearchPanelLoadDuration(wasPrefetch, durationMs);
184 } 184 }
185 185
186 // Not yet opened, wait till an open to log. 186 // Not yet opened, wait till an open to log.
187 mIsSearchPanelFullyPreloaded = true; 187 mIsSearchPanelFullyPreloaded = true;
188 } 188 }
189 189
190 /** 190 /**
191 * Called when a search term has been resolved.
192 * Currently this just logs time between initiating the search and resolving the search term
193 * into the uma metrics.
194 */
195 public void onSearchTermResolved() {
196 long durationMs = (System.nanoTime() - mSearchViewStartTimeNs) / 1000000 ;
Theresa 2016/02/29 19:42:44 mSearchViewStartTimeNs is set in onSeachPanelFirst
Donn Denman 2016/03/01 21:18:07 Wow, that was a big mistake. Thanks for catching
197 ContextualSearchUma.logSearchTermResolutionDuration(durationMs);
198 }
199
200 /**
201 * Called when navigation to prefetched search results first become viewable in the panel.
202 * Currently this just logs time-till-navigated into the uma metrics.
Theresa 2016/02/29 19:42:44 I think the wording on this docstring and "time-ti
Donn Denman 2016/03/01 21:18:07 Done.
203 */
204 public void onPrefetchedSearchNavigated(boolean didResolve) {
205 long durationMs = (System.nanoTime() - mSearchViewStartTimeNs) / 1000000 ;
206 ContextualSearchUma.logPrefetchedSearchNavigatedDuration(durationMs, did Resolve);
207 }
208
209 /**
191 * Records timing information when the search panel has been viewed for the first time. 210 * Records timing information when the search panel has been viewed for the first time.
192 */ 211 */
193 private void onSearchPanelFirstView() { 212 private void onSearchPanelFirstView() {
194 if (mIsSearchPanelFullyPreloaded) { 213 if (mIsSearchPanelFullyPreloaded) {
195 // Already fully pre-loaded, record a wait of 0 milliseconds. 214 // Already fully pre-loaded, record a wait of 0 milliseconds.
196 logSearchPanelLoadDuration(true, 0); 215 logSearchPanelLoadDuration(true, 0);
197 } else { 216 } else {
198 // Start a loading timer. 217 // Start a loading timer.
199 mSearchViewStartTimeNs = System.nanoTime(); 218 mSearchViewStartTimeNs = System.nanoTime();
200 } 219 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 /** 255 /**
237 * Logs the duration the user waited for the search panel to fully load, onc e it was opened. 256 * Logs the duration the user waited for the search panel to fully load, onc e it was opened.
238 * @param wasPrefetch Whether the load included prefetch. 257 * @param wasPrefetch Whether the load included prefetch.
239 * @param durationMs The duration to log. 258 * @param durationMs The duration to log.
240 */ 259 */
241 private void logSearchPanelLoadDuration(boolean wasPrefetch, long durationMs ) { 260 private void logSearchPanelLoadDuration(boolean wasPrefetch, long durationMs ) {
242 ContextualSearchUma.logSearchPanelLoadDuration(wasPrefetch, durationMs); 261 ContextualSearchUma.logSearchPanelLoadDuration(wasPrefetch, durationMs);
243 } 262 }
244 } 263 }
245 264
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698