chromium/components/omnibox/browser/autocomplete_controller_metrics.h

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_CONTROLLER_METRICS_H_
#define COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_CONTROLLER_METRICS_H_

#include <string>

#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ref.h"
#include "components/omnibox/browser/autocomplete_result.h"

class AutocompleteController;
class AutocompleteProvider;

// Used to track and log timing metrics for `AutocompleteController`. Logs 3
// sets of metrics:
// 1) How long until each async provider completes.
//    - Does not track intermediate updates if an async provider updates results
//      multiple times.
//    - Does not track sync providers (i.e., providers that don't use
//      `AutocompleteProvider::NotifyListeners()` to notify the
//      `AutocompleteController`.
//    - Tracks async providers completing syncly (i.e., providers that invoke
//      `AutocompleteProvider::NotifyListeners()` syncly; see the comment in
//      `AutocompleteController::OnProviderUpdate()`).
// 2) How long until the suggestions finalize.
//    - Does not track sync requests (i.e.,
//      `AutocompleteInput::omit_asynchronous_matches()` set to true).
//    - Does track async requests that complete syncly.
//    - Tracks suggestion additions, changes, and removals.
// 3) How many suggestions change during updates.
//    - Does not track sync request.
//    - Tracks both sync and async updates.
//    - Does not track suggestion removals.
//    - Tracks suggestion additions and changes.
class AutocompleteControllerMetrics {};

#endif  // COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_CONTROLLER_METRICS_H_