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

Unified Diff: chrome/browser/autocomplete/search_provider.cc

Issue 10832323: Adds a UMA histogram to monitor omnibox suggest requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/search_provider.cc
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
index 8bd2c9f2a0b88abb6363c7e3f40a9cf0511330f2..75d7d74dd7d1f927c3bead7f8b8cdf17a47975c9 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -293,12 +293,16 @@ void SearchProvider::Run() {
const TemplateURL* default_url = providers_.GetDefaultProviderURL();
if (default_url && !default_url->suggestions_url().empty()) {
suggest_results_pending_++;
+ // Increment bucket 1 in the histogram (number of requests sent).
+ UMA_HISTOGRAM_ENUMERATION("Omnibox.SuggestRequests", 1, 4);
default_fetcher_.reset(CreateSuggestFetcher(kDefaultProviderURLFetcherID,
default_url->suggestions_url_ref(), input_.text()));
}
const TemplateURL* keyword_url = providers_.GetKeywordProviderURL();
if (keyword_url && !keyword_url->suggestions_url().empty()) {
suggest_results_pending_++;
+ // Increment bucket 1 in the histogram (number of requests sent).
+ UMA_HISTOGRAM_ENUMERATION("Omnibox.SuggestRequests", 1, 4);
Ilya Sherman 2012/08/15 22:42:06 To avoid problems from typos and such, there are t
Mark P 2012/08/15 23:09:46 Good idea. Done.
keyword_fetcher_.reset(CreateSuggestFetcher(kKeywordProviderURLFetcherID,
keyword_url->suggestions_url_ref(), keyword_input_text_));
}
@@ -332,6 +336,9 @@ void SearchProvider::AddProviderInfo(ProvidersInfo* provider_info) const {
void SearchProvider::OnURLFetchComplete(const net::URLFetcher* source) {
DCHECK(!done_);
suggest_results_pending_--;
+ // Increment bucket 3 in the histogram (number of requests for which
+ // we received a response).
+ UMA_HISTOGRAM_ENUMERATION("Omnibox.SuggestRequests", 3, 4);
DCHECK_GE(suggest_results_pending_, 0); // Should never go negative.
const net::HttpResponseHeaders* const response_headers =
source->GetResponseHeaders();
@@ -549,6 +556,10 @@ bool SearchProvider::IsQuerySuitableForSuggest() const {
}
void SearchProvider::StopSuggest() {
+ // Increment bucket 2 in the histogram by the number of requests pending
+ // that were invalidated.
+ for (int i = 0; i < suggest_results_pending_; i++)
+ UMA_HISTOGRAM_ENUMERATION("Omnibox.SuggestRequests", 2, 4);
suggest_results_pending_ = 0;
timer_.Stop();
// Stop any in-progress URL fetches.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698