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

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

Issue 6679049: Adds some histograms from various omnibox queries. I'm doing this as (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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 | « chrome/browser/autocomplete/autocomplete.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/history_quick_provider.cc
diff --git a/chrome/browser/autocomplete/history_quick_provider.cc b/chrome/browser/autocomplete/history_quick_provider.cc
index af0148cd4ecfe5926f55c31c71a0fc44e73f7179..890c509c994082accb9feae3bb6b50b79968ce2b 100644
--- a/chrome/browser/autocomplete/history_quick_provider.cc
+++ b/chrome/browser/autocomplete/history_quick_provider.cc
@@ -7,7 +7,10 @@
#include "base/basictypes.h"
#include "base/i18n/break_iterator.h"
#include "base/logging.h"
+#include "base/metrics/histogram.h"
+#include "base/string_number_conversions.h"
#include "base/string_util.h"
+#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/history/history.h"
#include "chrome/browser/history/in_memory_url_index.h"
@@ -62,7 +65,16 @@ void HistoryQuickProvider::Start(const AutocompleteInput& input,
// someone unloads the history backend, we'll get inconsistent inline
// autocomplete behavior here.
if (GetIndex()) {
+ base::TimeTicks start_time = base::TimeTicks::Now();
DoAutocomplete();
+ if (input.text().size() < 6) {
+ base::TimeTicks end_time = base::TimeTicks::Now();
+ std::string name = "HistoryQuickProvider.QueryIndexTime." +
+ base::IntToString(input.text().size());
+ scoped_refptr<base::Histogram> counter = base::Histogram::FactoryGet(
jar (doing other things) 2011/03/14 20:30:21 nit/concern: This is all correct... and even makes
+ name, 1, 1000, 50, base::Histogram::kUmaTargetedHistogramFlag);
+ counter->Add((end_time - start_time).InMilliseconds());
+ }
UpdateStarredStateOfMatches();
}
}
« no previous file with comments | « chrome/browser/autocomplete/autocomplete.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698