chromium/tools/metrics/histograms/metadata/browsing_topics/histograms.xml

<!--
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.
-->

<!--
This file is used to generate a comprehensive list of Optimization histograms
along with a detailed description for each histogram.

For best practices on writing histogram descriptions, see
https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md

Please follow the instructions in the OWNERS file in this directory to find a
reviewer. If no OWNERS file exists, please consider signing up at
go/reviewing-metrics (Googlers only), as all subdirectories are expected to
have an OWNERS file. As a last resort you can send the CL to
[email protected].
-->

<histogram-configuration>

<histograms>

<histogram name="BrowsingTopics.ApiActionType"
    enum="BrowsingTopicsApiActionType" expires_after="2025-01-26">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    Records the action type of the request. Recorded when a topics request is
    handled in `BrowsingTopicsService`. Redirects (for fetch and xhr) will be
    counted as separate histogram entries.
  </summary>
</histogram>

<histogram name="BrowsingTopics.BrowsingTopicsState.LoadFinishStatus"
    enum="BooleanSuccess" expires_after="2025-02-10">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    Records the load finish status of BrowsingTopicsState. Recored when the
    state is loaded from the file at the start of each browser session.
  </summary>
</histogram>

<histogram
    name="BrowsingTopics.EpochTopicsCalculation.DidNotOccurAtScheduledTime.CalculationTimerIsRunning"
    enum="Boolean" expires_after="2025-02-02">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    If the scheduled topics calculation fails to run on time, records whether
    the calculation scheduling timer is running. This check occurs each time a
    new tab is created. The metric is recorded at most once per browser session.
  </summary>
</histogram>

<histogram
    name="BrowsingTopics.EpochTopicsCalculation.DidNotOccurAtScheduledTime.DaysSinceSessionStart"
    units="days" expires_after="2025-02-02">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    If the scheduled topics calculation fails to run on time, records the
    elapsed time (in days) since the profile session start. This check occurs
    each time a new tab is created. The metric is recorded at most once per
    browser session.
  </summary>
</histogram>

<histogram
    name="BrowsingTopics.EpochTopicsCalculation.DidNotOccurAtScheduledTime.HoursSinceScheduledTime"
    units="hours" expires_after="2025-02-02">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    If the scheduled topics calculation fails to run on time, records the
    elapsed time (in hours) from the scheduled time to the time of detection.
    This check occurs each time a new tab is created. The metric is recorded at
    most once per browser session.
  </summary>
</histogram>

<histogram
    name="BrowsingTopics.EpochTopicsCalculation.DidNotOccurAtScheduledTime.RemainingDaysInCalculationTimer"
    units="days" expires_after="2024-11-30">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    If the scheduled topics calculation fails to run on time, records the
    remaining time (in days) in the calculation scheduling timer. This check
    occurs each time a new tab is created. The metric is recorded only when the
    number is positive, and is recorded at most once per browser session.
  </summary>
</histogram>

<histogram
    name="BrowsingTopics.EpochTopicsCalculation.DidNotOccurAtScheduledTime.RemainingTimeInCalculationTimerIsPositive"
    enum="Boolean" expires_after="2025-02-02">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    If the scheduled topics calculation fails to run on time, records whether
    records whether remaining time in the calculation scheduling timer is
    positive. This check occurs at the end of each navigation. The metric is
    recorded at most once per browser session.
  </summary>
</histogram>

<histogram
    name="BrowsingTopics.EpochTopicsCalculation.EligibleDistinctHistoryHostsCount"
    units="hosts" expires_after="2025-02-10">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    Records the count of distinct history hosts that are eligible for topics
    calculation. Recorded during each (weekly) topics calculation after the
    observation domains are derived. In case of a calculation failure (e.g.
    permission denied, etc.), this metric won't be recorded.
  </summary>
</histogram>

<histogram
    name="BrowsingTopics.EpochTopicsCalculation.FirstTry.CalculatorResultStatus"
    enum="BrowsingTopicsCalculatorResultStatus" expires_after="2025-02-16">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    Records the browsing topics calculation result status (i.e. success, or the
    failure reason). Topics calculations can typically occur weekly, but can
    also be manually triggered from the topics-internals page, or can be retries
    of a previously failed calculation (due to hanging or data race). Recorded
    for the first try of a calculation (i.e. separated from the timeout retry)
    after the calculation completes, or when it's detected to be hanging, or
    when it's canceled due to data races or browser shutdown.
  </summary>
</histogram>

<histogram name="BrowsingTopics.EpochTopicsCalculation.Hanging.RetryNumber"
    units="retry number" expires_after="2025-02-23">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    Records the number of consecutive retries for a topic calculation (initial
    attempt = 0). Recorded when a topic calculation times out.
  </summary>
</histogram>

<histogram name="BrowsingTopics.EpochTopicsCalculation.HistoryTopicsCount"
    units="topics" expires_after="2025-01-05">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    Records the count of topics derived from history hosts in the past epoch
    (week). Recorded during each (weekly) topics calculation after the top
    topics are derived. In case of a calculation failure (e.g. permission
    denied, etc.), this metric won't be recorded.
  </summary>
</histogram>

<histogram
    name="BrowsingTopics.EpochTopicsCalculation.ObservationContextDomainsCountPerTopTopic"
    units="context domains" expires_after="2025-02-10">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    Records the count of context domains for each of the calculated top topics.
    This won't exceed the cap number
    `kBrowsingTopicsMaxNumberOfApiUsageContextDomainsToKeepPerTopic`. Recorded
    once for each calculated top topics, during each (weekly) topics calculation
    after the observation domains are derived. In case of a calculation failure
    (e.g. permission denied; candidate topic was blocked; etc.), this metric
    won't be recorded.
  </summary>
</histogram>

<histogram name="BrowsingTopics.EpochTopicsCalculation.Started.RetryNumber"
    units="retry number" expires_after="2025-02-23">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    Records the number of consecutive retries for a topic calculation (initial
    attempt = 0). Recorded when a topic calculation starts.
  </summary>
</histogram>

<histogram name="BrowsingTopics.EpochTopicsCalculation.TimeBetweenCalculations"
    units="ms" expires_after="2025-01-05">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    Records the time between top topic calculations. Recorded when a topic
    calculation finishes and results from a prior epoch are available. This
    metric is recorded even in case of a calculation failure (e.g. permission
    denied, etc.).
  </summary>
</histogram>

<histogram
    name="BrowsingTopics.EpochTopicsCalculation.TimeoutRetry.CalculatorResultStatus"
    enum="BrowsingTopicsCalculatorResultStatus" expires_after="2025-02-10">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    Records the browsing topics calculation result status (i.e. success, or the
    failure reason), for those that are triggered due to the previous
    calculation timed out. Topics calculations can typically occur weekly, but
    can also be manually triggered from the topics-internals page, or can be
    retries of a previously failed calculation (due to hanging or data race).
    Recorded when the timeout-retried topics calculation completes, or when it's
    detected to be hanging (again), or when it's canceled due to data races or
    browser shutdown.
  </summary>
</histogram>

<histogram
    name="BrowsingTopics.EpochTopicsCalculation.TopTopicsCountBeforePadding"
    units="topics" expires_after="2025-02-10">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    Records the count of derived top topics before random ones are padded.
    Recorded during each (weekly) topics calculation after the top topics are
    derived. In case of a calculation failure (e.g. permission denied, etc.),
    this metric won't be recorded.
  </summary>
</histogram>

<histogram name="BrowsingTopics.Fetch.InitialUrlRequest.Result"
    enum="BrowsingTopicsFetchRequestOrRedirectResult"
    expires_after="2025-02-10">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    When retrieving topics at the BrowsingTopicsURLLoaderInterceptor layer for
    the fetch() request for the initial URL, the success status or the failure
    reason.
  </summary>
</histogram>

<histogram name="BrowsingTopics.Fetch.RedirectedUrlRequest.Result"
    enum="BrowsingTopicsFetchRequestOrRedirectResult"
    expires_after="2025-02-10">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    When retrieving topics at the BrowsingTopicsURLLoaderInterceptor layer for
    the fetch() request for a redirected URL, the success status or the failure
    reason.
  </summary>
</histogram>

<histogram name="BrowsingTopics.JavaScriptAPI.TimeToResolve" units="ms"
    expires_after="2025-02-10">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    Records the time it takes for document.browsingTopics() to resolve. Recorded
    each time the promise is resolved.
  </summary>
</histogram>

<histogram name="BrowsingTopics.OverrideList.FileLoadResult"
    enum="BrowsingTopicsOverrideListFileLoadResult" expires_after="2024-12-30">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    The result of a single attempt to load the override list from disk, and
    parse it into a native object. Recorded once for every attempted load. Note
    that if an attempt fails it will not be re-attempted for the same file until
    the next browsing session, but a successful load will be recorded one or
    more times during a browsing session.
  </summary>
</histogram>

<histogram name="BrowsingTopics.OverrideList.UsedOverride" enum="Boolean"
    expires_after="2024-10-27">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    When the override list is checked, whether it contained the given input.
  </summary>
</histogram>

<histogram name="BrowsingTopics.PageLoad.OnTopicsFirstInvoked.RedirectCount"
    units="count" expires_after="2025-01-12">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    When Topics API is invoked on a page load for the first time, records the
    number of previous pages that were loaded via client-side redirects (without
    user activation).
  </summary>
</histogram>

<histogram
    name="BrowsingTopics.PageLoad.OnTopicsFirstInvoked.RedirectWithTopicsInvokedCount"
    units="count" expires_after="2025-01-12">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    When Topics API is invoked on a page load for the first time, records the
    number of previous pages that were loaded via client-side redirects (without
    user activation) that also invoked the Topics API.
  </summary>
</histogram>

<histogram name="BrowsingTopics.Result.FakeTopicCount"
    enum="BrowsingTopicsNumberOfTopics" expires_after="2025-01-26">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    When retrieving topics is a success, the number of those topics that were
    returned (weren't filtered) that were fake (noised).
  </summary>
</histogram>

<histogram name="BrowsingTopics.Result.FilteredTopicCount"
    enum="BrowsingTopicsNumberOfTopics" expires_after="2025-01-26">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    When retrieving topics is a success, the number of those topics that were
    not returned because they were filtered due to the caller not having
    observed the user on a site about that topic recently.
  </summary>
</histogram>

<histogram name="BrowsingTopics.Result.RealTopicCount"
    enum="BrowsingTopicsNumberOfTopics" expires_after="2025-01-19">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    When retrieving topics is a success, the number of those topics that were
    returned (weren't filtered) that were real topics (as opposed to noised).
  </summary>
</histogram>

<histogram name="BrowsingTopics.Result.Status"
    enum="BrowsingTopicsApiAccessResult" expires_after="2025-01-19">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    When retrieving topics at the BrowsingTopicsService layer (applicable to
    both javascript and headers), the success status or the failure reason.
  </summary>
</histogram>

<histogram name="BrowsingTopics.SiteDataStorage.FileSize.KB" units="KB"
    expires_after="2025-02-16">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    The size in kilobytes of the `BrowsingTopics` SQL database file. Recorded
    when the database is lazily and successfully initialized.
  </summary>
</histogram>

<histogram name="BrowsingTopics.SiteDataStorage.InitStatus"
    enum="BooleanSuccess" expires_after="2025-02-10">
  <owner>[email protected]</owner>
  <owner>[email protected]</owner>
  <summary>
    Records initialization status of BrowsingTopics SiteDataStorage database.
    Recorded when the database is lazily initialised when the first operation is
    encountered.
  </summary>
</histogram>

</histograms>

</histogram-configuration>