Commit a1fb72cf authored by Etienne Bergeron's avatar Etienne Bergeron Committed by Commit Bot

Add a metric to track omnibox warmup

Some omnibox janks are related to singleton not yet initialized.

We believe there can be lot of code running under the hood on the first
key stroke. We observed font cache initialisation, localisation loading, etc...

The intend of this metrics is to be able to compare popupation for the
first key stroke and for the normal use of omnibox.

R=mpearson@chromium.org

Bug: 868419
Change-Id: I191fd6ee564aa584b633b66a2f90fc7752b64633
Reviewed-on: https://chromium-review.googlesource.com/1210167Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589640}
parent a179f275
......@@ -209,6 +209,7 @@ AutocompleteController::AutocompleteController(
stop_timer_duration_(OmniboxFieldTrial::StopTimerFieldTrialDuration()),
done_(true),
in_start_(false),
first_query_(true),
search_service_worker_signal_sent_(false),
template_url_service_(provider_client_->GetTemplateURLService()) {
provider_types &= ~OmniboxFieldTrial::GetDisabledProviderTypes();
......@@ -351,6 +352,17 @@ void AutocompleteController::Start(const AutocompleteInput& input) {
// need the edit model to update the display.
UpdateResult(false, true);
// Omnibox has dependencies that may be lazily initialized. This metric will
// help tracking regression on the first use.
if (first_query_) {
base::TimeTicks end_time = base::TimeTicks::Now();
base::HistogramBase* counter =
base::Histogram::FactoryGet("Omnibox.WarmupTime", 1, 1000, 50,
base::Histogram::kUmaTargetedHistogramFlag);
counter->Add(static_cast<int>((end_time - start_time).InMilliseconds()));
first_query_ = false;
}
// If the input looks like a query, send a signal predicting that the user is
// going to issue a search (either to the default search engine or to a
// keyword search engine, as indicated by the destination_url). This allows
......
......@@ -266,6 +266,9 @@ class AutocompleteController : public AutocompleteProviderListener,
// notifications until Start() has been invoked on all providers.
bool in_start_;
// Indicate whether it is the first query since startup.
bool first_query_;
// True if the signal predicting a likely search has already been sent to the
// service worker context during the current input session. False on
// controller creation and after |ResetSession| is called.
......
......@@ -67797,6 +67797,18 @@ uploading your change for review.
</summary>
</histogram>
<histogram name="Omnibox.WarmupTime" units="ms">
<owner>etienneb@chromium.org</owner>
<owner>mpearson@chromium.org</owner>
<summary>
Time it takes for the omnibox to process the first user interaction after
startup. This measures the time it takes to start all autocomplete providers
and their initialisation steps. This metric may be recorded twice as there
is the normal omnibox path and also the &quot;classify text&quot; path to
the autocomplete system.
</summary>
</histogram>
<histogram name="Omnibox.ZeroSuggest.Eligible.OnFocus"
enum="ZeroSuggestEligibleOnFocus">
<owner>mpearson@chromium.org</owner>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment