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

Unified Diff: chrome/browser/autocomplete/autocomplete.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: Fix compile error 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 | « no previous file | chrome/browser/autocomplete/history_quick_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete.cc
diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc
index 4226bae151166e1472d2782ee02416ca6e6785e8..1f4a10e60bd99558c582314414ec32fd3a91b3c6 100644
--- a/chrome/browser/autocomplete/autocomplete.cc
+++ b/chrome/browser/autocomplete/autocomplete.cc
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/i18n/number_formatting.h"
+#include "base/metrics/histogram.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
@@ -852,12 +853,20 @@ void AutocompleteController::Start(const string16& text,
// Start the new query.
in_start_ = true;
+ base::TimeTicks start_time = base::TimeTicks::Now();
for (ACProviders::iterator i(providers_.begin()); i != providers_.end();
++i) {
(*i)->Start(input_, minimal_changes);
if (synchronous_only)
DCHECK((*i)->done());
}
+ if (!synchronous_only && text.size() < 6) {
+ base::TimeTicks end_time = base::TimeTicks::Now();
+ std::string name = "Omnibox.QueryTime." + base::IntToString(text.size());
+ scoped_refptr<base::Histogram> counter = base::Histogram::FactoryGet(
+ name, 1, 1000, 50, base::Histogram::kUmaTargetedHistogramFlag);
+ counter->Add(static_cast<int>((end_time - start_time).InMilliseconds()));
+ }
in_start_ = false;
CheckIfDone();
UpdateResult(true);
« no previous file with comments | « no previous file | chrome/browser/autocomplete/history_quick_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698