<!--
Copyright 2021 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 Prefetch 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
chromium-metrics-reviews@google.com.
-->

<histogram-configuration>

<histograms>

<variants name="PrefetchProxyCanaryCheckerClient">
  <variant name="DNS" summary="DNS canary check"/>
  <variant name="TLS" summary="TLS canary check"/>
</variants>

<variants name="PrerenderOrNonPrerender">
  <variant name="NonPrerender" summary="the navigation is not prerender"/>
  <variant name="Prerender" summary="the navigaiton is prerender"/>
</variants>

<!-- LINT.IfChange(TriggerTypeAndEagerness) -->

<variants name="TriggerTypeAndEagerness">
  <variant name="Embedder_BookmarkBar" summary="Embedder trigger, BookmarkBar"/>
  <variant name="Embedder_ChromeCustomTabs"
      summary="Embedder trigger, ChromeCustomTabs"/>
  <variant name="Embedder_DefaultSearchEngine"
      summary="Embedder trigger, DefaultSearchEngine"/>
  <variant name="Embedder_NewTabPage" summary="Embedder trigger, NewTabPage"/>
  <variant name="Embedder_WebView" summary="Embedder trigger, WebView"/>
  <variant name="SpeculationRule_Conservative"
      summary="SpeculationRules trigger, Conservative"/>
  <variant name="SpeculationRule_Eager2"
      summary="SpeculationRules trigger, Eager"/>
  <variant name="SpeculationRule_Immediate2"
      summary="SpeculationRules trigger, Immediate"/>
  <variant name="SpeculationRule_Moderate"
      summary="SpeculationRules trigger, Moderate"/>
  <variant name="SpeculationRuleFromAutoSpeculationRules_Conservative"
      summary="SpeculationRulesFromAutoSpeculationRules trigger, Conservative"/>
  <variant name="SpeculationRuleFromAutoSpeculationRules_Eager2"
      summary="SpeculationRulesFromAutoSpeculationRules trigger, Eager"/>
  <variant name="SpeculationRuleFromAutoSpeculationRules_Immediate2"
      summary="SpeculationRulesFromAutoSpeculationRules trigger, Immediate"/>
  <variant name="SpeculationRuleFromAutoSpeculationRules_Moderate"
      summary="SpeculationRulesFromAutoSpeculationRules trigger, Moderate"/>
  <variant name="SpeculationRuleFromIsolatedWorld_Conservative"
      summary="SpeculationRulesFromIsolatedWorld trigger, Conservative"/>
  <variant name="SpeculationRuleFromIsolatedWorld_Eager2"
      summary="SpeculationRulesFromIsolatedWorld trigger, Eager"/>
  <variant name="SpeculationRuleFromIsolatedWorld_Immediate2"
      summary="SpeculationRulesFromIsolatedWorld trigger, Immediate"/>
  <variant name="SpeculationRuleFromIsolatedWorld_Moderate"
      summary="SpeculationRulesFromIsolatedWorld trigger, Moderate"/>
</variants>

<!-- LINT.ThenChange(//content/browser/preloading/prefetch/prefetch_params.cc:GetMetricsSuffixTriggerTypeAndEagerness) -->

<variants name="ValidateResourceRequestHeaders">
  <variant name="CorsExemptHeaders"
      summary="ResourceRequest::cors_exempt_headers"/>
  <variant name="Headers" summary="ResourceRequest::headers"/>
</variants>

<variants name="ValidateResourceRequestMode">
  <variant name="AfterWillCreateURLLoaderFactory"
      summary="after WillCreateURLLoaderFactory"/>
  <variant name="OnRequestConstruction"
      summary="upon PrefetchContainer request construction"/>
</variants>

<variants name="WasServed">
  <variant name="NotServed" summary="not served"/>
  <variant name="Served" summary="served"/>
</variants>

<histogram
    name="Prefetch.BlockUntilHeadDuration.PerMatchingCandidate.{PrerenderOrNonPrerender}.{WasServed}.{TriggerTypeAndEagerness}"
    units="ms" expires_after="2027-02-07">
  <owner>kenoss@chromium.org</owner>
  <owner>taiyo@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    When a navigation started, `PrefetchMatchResolver` collects potentially
    matching prefetches for it. Judging a prefetch actually matches or not needs
    non-redirect header. If a prefetch has non-redirect header and actually
    matched, then this process ends synchronously. If not, it waits non-redirect
    headers until it finds a matched and servable one or there is no more
    candidates.

    This histogram records that duration navigation was blocked by the prefetch
    matching, when the matching is settled. Zero is recorded when the navigation
    is not blocked.

    This histogram is recorded per potentially matching candidate, with its
    TriggerType and Eagerness as {TriggerTypeAndEagerness}, and whether its
    candidate was eventually served or not as {WasServed}.

    Recorded iff {PrerenderOrNonPrerender}.
  </summary>
  <token key="PrerenderOrNonPrerender" variants="PrerenderOrNonPrerender"/>
  <token key="WasServed" variants="WasServed"/>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.BlockUntilHeadDuration.PerMatchingCandidate.{WasServed}.{TriggerTypeAndEagerness}"
    units="ms" expires_after="2027-01-10">
  <owner>kenoss@chromium.org</owner>
  <owner>taiyo@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    When a navigation started, `PrefetchMatchResolver` collects potentially
    matching prefetches for it. Judging a prefetch actually matches or not needs
    non-redirect header. If a prefetch has non-redirect header and actually
    matched, then this process ends synchronously. If not, it waits non-redirect
    headers until it finds a matched and servable one or there is no more
    candidates.

    This histogram records that duration navigation was blocked by the prefetch
    matching, when the matching is settled. Zero is recorded when the navigation
    is not blocked.

    This histogram is recorded per potentially matching candidate, with its
    TriggerType and Eagerness as {TriggerTypeAndEagerness}, and whether its
    candidate was eventually served or not as {WasServed}.

    Before 2025-04-25, this histogram was recorded as
    `PrefetchProxy.AfterClick.BlockUntilHeadDuration2NoBias.*`.
  </summary>
  <token key="WasServed" variants="WasServed"/>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.PrefetchContainer.AddedToDomainLookupStarted2.{TriggerTypeAndEagerness}"
    units="ms" expires_after="2027-01-17">
  <owner>yoichio@chromium.org</owner>
  <owner>taiyo@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Records the duration from when `PrefetchContainer` is added to
    `PrefetchService` to when the domain lookup for the corresponding URL
    request is started.

    This metric is recorded when `PrefetchContainer::dtor()` is called if it
    received a non-redirect header and domain lookup was performed.

    This histogram is only recorded for prefetches of {TriggerTypeAndEagerness}.
  </summary>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.PrefetchContainer.AddedToHeaderDeterminedSuccessfully.{TriggerTypeAndEagerness}"
    units="ms" expires_after="2027-02-14">
  <owner>kenoss@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Records duration from when `PrefetchContainer` is added to `PrefetchService`
    to when `PrefetchContainer` received non-redirect header.

    This metrics is recorded when `PrefetchContainer::dtor()` is called if it
    received non-redirect header.

    This histogram is only recorded for prefetches of {TriggerTypeAndEagerness}.
  </summary>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.PrefetchContainer.AddedToInitialEligibility.{TriggerTypeAndEagerness}"
    units="ms" expires_after="2027-02-14">
  <owner>kenoss@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Records duration from when `PrefetchContainer` is added to `PrefetchService`
    to when `PrefetchContainer` received initial eligibility.

    This metrics is recorded when `PrefetchContainer::dtor()` is called if it
    passed initial eligibility check.

    This histogram is only recorded for prefetches of {TriggerTypeAndEagerness}.
  </summary>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.PrefetchContainer.AddedToPrefetchCompletedSuccessfully.{TriggerTypeAndEagerness}"
    units="ms" expires_after="2027-02-14">
  <owner>kenoss@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Records duration from when `PrefetchContainer` is added to `PrefetchService`
    to when `PrefetchContainer` finished load successfully.

    This metrics is recorded when `PrefetchContainer::dtor()` is called if it
    completed the load successfully.

    This histogram is only recorded for prefetches of {TriggerTypeAndEagerness}.
  </summary>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.PrefetchContainer.AddedToPrefetchStarted.{TriggerTypeAndEagerness}"
    units="ms" expires_after="2027-02-14">
  <owner>kenoss@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Records duration from when `PrefetchContainer` is added to `PrefetchService`
    to when `PrefetchService` starts its loading process (i.e.,
    `PrefetchService::StartSinglePrefetch` is called).

    This metrics is recorded when `PrefetchContainer::dtor()` is called if it
    started the load.

    This histogram is only recorded for prefetches of {TriggerTypeAndEagerness}.
  </summary>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.PrefetchContainer.AddedToURLRequestStarted.{TriggerTypeAndEagerness}"
    units="ms" expires_after="2027-02-14">
  <owner>taiyo@chromium.org</owner>
  <owner>kenoss@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Records the duration from when `PrefetchContainer` is added to
    `PrefetchService` to when its URLRequest is started in //net layer (i.e.,
    when `URLRequest::Start()` is called).

    This metrics is recorded when `PrefetchContainer::dtor()` is called if it
    received a non-redirect header.

    This histogram is only recorded for prefetches of {TriggerTypeAndEagerness}.
  </summary>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.PrefetchContainer.ConnectedCallbackDelay.{TriggerTypeAndEagerness}"
    units="ms" expires_after="2026-11-12">
  <owner>hayato@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Records the time taken to call http network transaction connected callback.

    This metrics is recorded when `PrefetchContainer::dtor()` is called if it
    started the load.

    This histogram is only recorded for prefetches of {TriggerTypeAndEagerness}.
  </summary>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.PrefetchContainer.CreateStreamDelay.{TriggerTypeAndEagerness}"
    units="ms" expires_after="2026-11-12">
  <owner>hayato@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Records the time taken for HTTP stream creation to finish.

    This metrics is recorded when `PrefetchContainer::dtor()` is called if it
    started the load.

    This histogram is only recorded for prefetches of {TriggerTypeAndEagerness}.
  </summary>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.PrefetchContainer.InitialEligibilityToPrefetchStarted.{TriggerTypeAndEagerness}"
    units="ms" expires_after="2027-01-31">
  <owner>taiyo@chromium.org</owner>
  <owner>kenoss@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Records the duration from when `PrefetchContainer` receives initial
    eligibility` to when `PrefetchService` starts its loading process (i.e.,
    `PrefetchService::StartSinglePrefetch` is called), which typically
    represents the duration the prefetch waits on the scheduler's queue.

    This metrics is recorded when `PrefetchContainer::dtor()` is called if it
    started the load.

    This histogram is only recorded for prefetches of {TriggerTypeAndEagerness}.
  </summary>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.PrefetchContainer.InitializeStreamDelay.{TriggerTypeAndEagerness}"
    units="ms" expires_after="2026-11-12">
  <owner>hayato@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Records the time taken for HTTP stream initialization to finish if the
    initialization was blocked, otherwise zero.

    This metrics is recorded when `PrefetchContainer::dtor()` is called if it
    started the load.

    This histogram is only recorded for prefetches of {TriggerTypeAndEagerness}.
  </summary>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.PrefetchContainer.PrefetchMatchMissedToPrefetchStarted.{TriggerTypeAndEagerness}"
    units="ms" expires_after="2026-06-21">
  <owner>wbjacksonjr@chromium.org</owner>
  <owner>taiyo@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Records the time delta between a missed prefetch matching and a subsequent
    prefetch for the same resource. This is logged when a prefetch request is
    sent to the network for a URL that was recently navigated to by the user and
    that could have been served by the prefetch if it had been available. A
    smaller time delta indicates a potential race condition between the
    navigation and the prefetch. This metric is logged in milliseconds and is
    only recorded against the latest navigation that could've matched with the
    prefetch.

    Note that this is calculated from non-SW-controlled `PrefetchMatchResolver`
    i.e. it is calculated for each redirect, and it ignores SW-controlled
    `PrefetchMatchResolver` case. Also, this information of being unmatched is
    stored in an LRU with a limited size, so older mismatches might not be taken
    into account. Please see
    `PrefetchService::recent_unmatched_navigated_keys_for_metrics_` for more
    details.

    This histogram is only recorded for prefetches of {TriggerTypeAndEagerness}.
  </summary>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.PrefetchContainer.PrefetchStartedToDomainLookupStarted2.{TriggerTypeAndEagerness}"
    units="ms" expires_after="2026-11-12">
  <owner>yoichio@chromium.org</owner>
  <owner>taiyo@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Records the duration from when `PrefetchService` starts its loading process
    (i.e., `PrefetchService::StartSinglePrefetch` is called) to when the domain
    lookup for the corresponding URL request is started.

    This metric is recorded when `PrefetchContainer::dtor()` is called if it
    received a non-redirect header and domain lookup was performed.

    This histogram is only recorded for prefetches of {TriggerTypeAndEagerness}.
  </summary>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.PrefetchContainer.PrefetchStartedToHeaderDeterminedSuccessfully.{TriggerTypeAndEagerness}"
    units="ms" expires_after="2027-02-07">
  <owner>taiyo@chromium.org</owner>
  <owner>kenoss@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Records the duration from when `PrefetchService` starts its loading process
    (i.e., `PrefetchService::StartSinglePrefetch` is called) to when
    `PrefetchContainer` received non-redirect header.

    This metrics is recorded when `PrefetchContainer::dtor()` is called if it
    received non-redirect header.

    This histogram is only recorded for prefetches of {TriggerTypeAndEagerness}.
  </summary>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.PrefetchContainer.PrefetchStartedToPrefetchCompletedSuccessfully.{TriggerTypeAndEagerness}"
    units="ms" expires_after="2027-01-31">
  <owner>taiyo@chromium.org</owner>
  <owner>kenoss@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Records the duration from when `PrefetchService` starts its loading process
    (i.e., `PrefetchService::StartSinglePrefetch` is called) to when
    `PrefetchContainer` finished load successfully.

    This metrics is recorded when `PrefetchContainer::dtor()` is called if it
    completed the load successfully.

    This histogram is only recorded for prefetches of {TriggerTypeAndEagerness}.
  </summary>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.PrefetchContainer.PrefetchStartedToURLRequestStarted.{TriggerTypeAndEagerness}"
    units="ms" expires_after="2027-01-31">
  <owner>taiyo@chromium.org</owner>
  <owner>kenoss@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Records the duration from when `PrefetchService` starts its loading process
    (i.e., `PrefetchService::StartSinglePrefetch` is called) to when its
    URLRequest is started in //net layer (i.e., when `URLRequest::Start()` is
    called).

    This metrics is recorded when `PrefetchContainer::dtor()` is called if it
    received a non-redirect header.

    This histogram is only recorded for prefetches of {TriggerTypeAndEagerness}.
  </summary>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.PrefetchContainer.ServedCount.{TriggerTypeAndEagerness}"
    units="count" expires_after="2027-02-07">
  <owner>taiyo@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    This histogram records how many times the `PrefetchContainer` has been
    served to the navigation.

    The count is incremented when `PrefetchContainer` receives the
    `PrefetchMatchResolver`'s notification that the container is serevd (i.e.
    `PrefetchMatchResolver::UnregisterCandidate`), and its value is recorded on
    `PrefetchContainer::dtor()`.

    This histogram is recorded with its TriggerType and Eagerness as
    {TriggerTypeAndEagerness}.
  </summary>
</histogram>

<histogram
    name="Prefetch.PrefetchMatchingBlockedNavigation.PerMatchingCandidate.{PrerenderOrNonPrerender}.{TriggerTypeAndEagerness}"
    enum="Boolean" expires_after="2027-02-07">
  <owner>kouhei@chromium.org</owner>
  <owner>kenoss@chromium.org</owner>
  <owner>taiyo@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    When a navigation started, `PrefetchMatchResolver` collects potentially
    matching prefetches for it. Judging a prefetch actually matches or not needs
    non-redirect header. If a prefetch has non-redirect header and actually
    matched, then this process ends synchronously. If not, it waits non-redirect
    headers until it finds a matched and servable one or there is no more
    candidates.

    This histogram records whether this process ends synchronously (i.e. whether
    prefetch matching blocked the navigation), when the above prefetch matching
    is settled.

    This histogram is recorded per potentially matching candidates, with its
    TriggerType and Eagerness as {TriggerTypeAndEagerness}. Recorded iff
    {PrerenderOrNonPrerender}.
  </summary>
  <token key="PrerenderOrNonPrerender" variants="PrerenderOrNonPrerender"/>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.PrefetchMatchingBlockedNavigation.PerMatchingCandidate.{TriggerTypeAndEagerness}"
    enum="Boolean" expires_after="2027-02-07">
  <owner>kouhei@chromium.org</owner>
  <owner>kenoss@chromium.org</owner>
  <owner>taiyo@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    When a navigation started, `PrefetchMatchResolver` collects potentially
    matching prefetches for it. Judging a prefetch actually matches or not needs
    non-redirect header. If a prefetch has non-redirect header and actually
    matched, then this process ends synchronously. If not, it waits non-redirect
    headers until it finds a matched and servable one or there is no more
    candidates.

    This histogram records whether this process ends synchronously (i.e. whether
    prefetch matching blocked the navigation), when the above prefetch matching
    is settled.

    This histogram is recorded per potentially matching candidates, with its
    TriggerType and Eagerness as {TriggerTypeAndEagerness}.

    Before 2025-04-25, this histogram was recorded as
    `PrefetchProxy.AfterClick.PrefetchMatchingBlockedNavigationWithPrefetch.*`
  </summary>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.PrefetchMatchResolver.ExistsPaopThen.PrefetchPotentialCandidateCollectResult"
    enum="PrefetchPotentialCandidateCollectResult" expires_after="2027-01-17">
  <owner>kenoss@chromium.org</owner>
  <owner>chrome-prerendering@google.com</owner>
  <summary>
    Records `PrefetchPotentialCandidateCollectResult` when a prerender that
    triggered prefetch ahead of prerender, tried to use prefetch but there is no
    prefetch candidate in `PrefetchMatchResolver`.
  </summary>
</histogram>

<histogram
    name="Prefetch.PrefetchMatchResolver.OnDeterminedHeadWithUnmatch.PotentialCandidateServingResultAndServableStateAndMatcherAction"
    units="code" expires_after="2027-01-17">
  <owner>kenoss@chromium.org</owner>
  <owner>chrome-prerendering@google.com</owner>
  <summary>
    The combination of `PrefetchPotentialCandidateServingResult`,
    `PrefetchServableState`, and `PrefetchMatchResolverAction`. See
    `GetCodeOfPotentialCandidateServingResultAndServableStateAndMatcherAction()`
    for the details of the value.

    How to decode: prompt: &quot; Generate a python program that decodes
    `GetCodeOfPotentialCandidateServingResultAndServableStateAndMatcherAction()`.

    Example:

    ``` $ decode.py 124181
    ('PrefetchPotentialCandidateServingResult::kNotServedLoadFailed',
    'PrefetchServableState::kNotServable',
    'PrefetchMatchResolverAction::ActionKind::kDrop',
    'PrefetchContainer::LoadState::kFailedDeterminedHead', None) ``` &quot;

    Recorded when prefetch matching received unmatch in
    `PrefetchMatchResolver::OnDeterminedHead()`.
  </summary>
</histogram>

<histogram
    name="Prefetch.PrefetchPotentialCandidateServingResult.PerMatchingCandidate.{TriggerTypeAndEagerness}"
    enum="PrefetchPotentialCandidateServingResult" expires_after="2027-02-07">
  <owner>taiyo@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    When a navigation started, `PrefetchMatchResolver` collects potentially
    matching prefetches for it. Judging a prefetch actually matches or not needs
    non-redirect header. If a prefetch has non-redirect header and actually
    matched, then this judging ends synchronously. If not, it being the
    `PrefetchMatchResolver` waits for non-redirect headers until it finds a
    matched and servable one or there is no more candidates.

    This histogram records the result of the serving judgement per those
    potentially matching candidates. Recorded when that serving judgement is
    settled and the candidate is unregistered from the resolver (i.e.
    `PrefetchMatchResolver::UnregisterCandidate`).

    This histogram is recorded per potentially matching candidate, with its
    TriggerType and Eagerness as {TriggerTypeAndEagerness}.
  </summary>
  <token key="TriggerTypeAndEagerness" variants="TriggerTypeAndEagerness"/>
</histogram>

<histogram
    name="Prefetch.PrePrefetchRequestValidation.{ValidateResourceRequestMode}.{ValidateResourceRequestHeaders}.HasMismatch"
    enum="Boolean" expires_after="2026-12-31">
  <owner>taiyo@chromium.org</owner>
  <owner>hiroshige@chromium.org</owner>
  <summary>
    Records if there are any mismatched headers in
    {ValidateResourceRequestHeaders} in ValidateResourceRequestForPrePrefetch.
    Logged for every PrePrefetch-initiated prefetch
    {ValidateResourceRequestMode}.
  </summary>
  <token key="ValidateResourceRequestHeaders"
      variants="ValidateResourceRequestHeaders"/>
  <token key="ValidateResourceRequestMode"
      variants="ValidateResourceRequestMode"/>
</histogram>

<histogram
    name="Prefetch.PrePrefetchRequestValidation.{ValidateResourceRequestMode}.{ValidateResourceRequestHeaders}.Mismatched"
    enum="RequestHeader" expires_after="2026-12-31">
  <owner>taiyo@chromium.org</owner>
  <owner>hiroshige@chromium.org</owner>
  <summary>
    Records the header name of every mismatched header in
    {ValidateResourceRequestHeaders} in ValidateResourceRequestForPrePrefetch.
    Logged for every mismatched header for every PrePrefetch-initiated
    prefetches {ValidateResourceRequestMode}.
  </summary>
  <token key="ValidateResourceRequestHeaders"
      variants="ValidateResourceRequestHeaders"/>
  <token key="ValidateResourceRequestMode"
      variants="ValidateResourceRequestMode"/>
</histogram>

<histogram
    name="PrefetchProxy.AfterClick.Mainframe.CookieCopyStartToInterceptorCheck"
    units="ms" expires_after="2025-03-01">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Cross-Origin prefetches are made in an isolated network context. When the
    prefetched link is navigated to, the cookies are copied from this isolated
    network context to the user's default network context.

    This histogram records the time from the start of the cookie copy to when
    the URL interceptor trying to serve the prefetch checks the status of the
    cookie copy.

    Warning: this histogram was expired from 2024-09-01 to 2024-10-11; data may
    be missing.
  </summary>
</histogram>

<histogram name="PrefetchProxy.AfterClick.Mainframe.CookieCopyTime" units="ms"
    expires_after="2025-03-09">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Cross-Origin prefetches are made in an isolated network context. When the
    prefetched link is navigated to, the cookies are copied from this isolated
    network context to the user's default network context.

    This histogram records the time required to copy cookies from the isolated
    network context used for a prefetch to the user's default network context
    after a prefetched link is navigated to.
  </summary>
</histogram>

<histogram name="PrefetchProxy.AfterClick.Mainframe.CookieReadTime" units="ms"
    expires_after="2025-03-01">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Cross-Origin prefetches are made in an isolated network context. When the
    prefetched link is navigated to, the cookies are copied from this isolated
    network context to the user's default network context.

    This histogram records the time required to read the cookies from the
    isolated network context used for a prefetch before being copied to the
    user's default network context after a prefetched link is navigated to. Note
    this does not include the time it takes to write the cookies to the default
    network context.
  </summary>
</histogram>

<histogram name="PrefetchProxy.AfterClick.Mainframe.CookieWaitTime" units="ms"
    expires_after="2025-03-01">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Records the amount of time that the navigation to a previously prefetched
    page was delayed because cookies had to be copied from the isolated cookie
    jar.

    This is only the amount of time in which the cookie copy process blocks
    intercepting the navigation. The overall time it takes for the cookie copy
    process is recorded to the
    &quot;PrefetchProxy.AfterClick.Mainframe.Cookie(Copy|Read|Write)Time&quot;
    histograms.

    Warning: this histogram was expired from 2024-09-01 to 2024-10-11; data may
    be missing.
  </summary>
</histogram>

<histogram name="PrefetchProxy.AfterClick.Mainframe.CookieWriteTime" units="ms"
    expires_after="2025-03-01">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Cross-Origin prefetches are made in an isolated network context. When the
    prefetched link is navigated to, the cookies are copied from this isolated
    network context to the user's default network context.

    This histogram records the time required to write cookies from the isolated
    network context used for a prefetch to the user's default network context
    after a prefetched link is navigated to. Note this does not include the time
    it takes to read the cookies from the isolated network context.

    Warning: this histogram was expired from 2024-09-01 to 2024-10-11; data may
    be missing.
  </summary>
</histogram>

<histogram name="PrefetchProxy.AfterClick.RedirectChainSize" units="count"
    expires_after="2027-01-24">
  <owner>kouhei@chromium.org</owner>
  <owner>kenoss@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    The redirect chain size of a served prefetch. This histogram is recorded
    only for prefetches that are served for a navigation.

    Warning: this histogram was expired from 2024-09-01 to 2024-11-07; data may
    be missing.
  </summary>
</histogram>

<histogram name="PrefetchProxy.AfterClick.WasFullRedirectChainServed"
    enum="Boolean" expires_after="2026-09-27">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Whether the full redirect chain of a prefetch is served (true), or just part
    of the redirect was served (false). This histogram is only recorded when: 1)
    the prefetch had at least one redirect (i.e. the redirect chain is at least
    2), and 2) at least part of prefetch redirect chain is served.
  </summary>
</histogram>

<histogram
    name="PrefetchProxy.CanaryChecker.CacheEntryAge.{PrefetchProxyCanaryCheckerClient}"
    units="hours" expires_after="2025-04-27">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    How old a cached probe result was when it was used, in hours.
  </summary>
  <token key="PrefetchProxyCanaryCheckerClient"
      variants="PrefetchProxyCanaryCheckerClient"/>
</histogram>

<histogram
    name="PrefetchProxy.CanaryChecker.CacheLookupResult.{PrefetchProxyCanaryCheckerClient}"
    enum="CanaryCheckLookupResult" expires_after="2026-03-15">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Records the status of canary check cache lookups. A sample is recorded every
    time Chrome attempts to use a resource prefetched using the prefetch proxy.
    Cache misses or cached failures result in filter probing the origin before
    the prefetched response can be used.

    Warning: this histogram was expired from 2024-09-01 to 2024-10-11; data may
    be missing.
  </summary>
  <token key="PrefetchProxyCanaryCheckerClient"
      variants="PrefetchProxyCanaryCheckerClient"/>
</histogram>

<histogram
    name="PrefetchProxy.CanaryChecker.FinalState.{PrefetchProxyCanaryCheckerClient}"
    enum="BooleanSuccess" expires_after="2026-03-15">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Records the end state of a probe just before it goes inactive. This happens
    when the prober succeeds, fails and has no more retries, or the delegate
    stops probing.

    Warning: this histogram was expired from 2024-09-01 to 2024-10-11; data may
    be missing.
  </summary>
  <token key="PrefetchProxyCanaryCheckerClient"
      variants="PrefetchProxyCanaryCheckerClient"/>
</histogram>

<histogram
    name="PrefetchProxy.CanaryChecker.NetError.{PrefetchProxyCanaryCheckerClient}"
    enum="NetErrorCodes" expires_after="2026-03-15">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Records the net error of a completed or timed out probe. Note that if a HTTP
    response does not occur within the probe's TTL, when a sample will also be
    added to the ERR_TIMED_OUT bucket.

    Warning: this histogram was expired from 2024-09-01 to 2024-10-11; data may
    be missing.
  </summary>
  <token key="PrefetchProxyCanaryCheckerClient"
      variants="PrefetchProxyCanaryCheckerClient"/>
</histogram>

<histogram
    name="PrefetchProxy.CanaryChecker.NumAttemptsBeforeSuccess.{PrefetchProxyCanaryCheckerClient}"
    units="count" expires_after="2025-03-01">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Records the number of attempts that are made to achieve a successful canary
    check. This is recorded every time we make a canary check and the result is
    a success. In particular, this means this is no recorded when a result was
    already cached or when the check attempt fails after exhausting its retries.
    This metric is 1-based so if a probe succeeds the first time, a sample of 1
    will be recorded.

    Warning: this histogram was expired from 2024-09-01 to 2024-10-11; data may
    be missing.
  </summary>
  <token key="PrefetchProxyCanaryCheckerClient"
      variants="PrefetchProxyCanaryCheckerClient"/>
</histogram>

<histogram
    name="PrefetchProxy.CanaryChecker.TimeUntilFailure.{PrefetchProxyCanaryCheckerClient}"
    units="ms" expires_after="2027-02-07">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Records the amount of time spent working on a single probe attempt to get to
    a failed state. Recorded every time a probe fails.

    Warning: this histogram was expired from 2024-09-01 to 2024-10-11; data may
    be missing.
  </summary>
  <token key="PrefetchProxyCanaryCheckerClient"
      variants="PrefetchProxyCanaryCheckerClient"/>
</histogram>

<histogram
    name="PrefetchProxy.CanaryChecker.TimeUntilSuccess.{PrefetchProxyCanaryCheckerClient}"
    units="ms" expires_after="2026-03-15">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Records the amount of time spent working on a single probe attempt to get to
    a successful state. Recorded every time a probe succeeds.

    Warning: this histogram was expired from 2024-09-01 to 2024-10-11; data may
    be missing.
  </summary>
  <token key="PrefetchProxyCanaryCheckerClient"
      variants="PrefetchProxyCanaryCheckerClient"/>
</histogram>

<histogram name="PrefetchProxy.Prefetch.Mainframe.BodyLength" units="bytes"
    expires_after="2026-09-20">
  <owner>kouhei@chromium.org</owner>
  <owner>kenoss@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Records the response body length as cached in memory encountered when
    prefetching a mainframe HTML resource. Recorded for non-network error
    prefetches only.

    Warning: this histogram was expired from 2024-09-01 to 2024-11-07; data may
    be missing.
  </summary>
</histogram>

<histogram name="PrefetchProxy.Prefetch.Mainframe.ConnectTime" units="ms"
    expires_after="2027-01-24">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Records the time taken to establish a socket connection when prefetching a
    mainframe HTML resource. Recorded for non-network error prefetches only.

    Warning: this histogram was expired from 2024-07-21 to 2024-10-11; data may
    be missing.
  </summary>
</histogram>

<histogram name="PrefetchProxy.Prefetch.Mainframe.CookiesToCopy" units="count"
    expires_after="2024-09-01">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Records the number of cookies that needed to be copied from the prefetch
    navigation to the user's profile after a prefetched link is navigated to.
  </summary>
</histogram>

<histogram name="PrefetchProxy.Prefetch.Mainframe.NetError"
    enum="NetErrorCodes" expires_after="2027-01-24">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Records the Net Error encountered when prefetching a mainframe HTML
    resource. Recorded for every completed prefetch.

    Warning: this histogram was expired from 2024-09-01 to 2024-10-11; data may
    be missing.
  </summary>
</histogram>

<histogram name="PrefetchProxy.Prefetch.Mainframe.RespCode"
    enum="HttpResponseCode" expires_after="2026-12-27">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Records the HTTP response code encountered when prefetching a mainframe HTML
    resource. Recorded for non-network error prefetches only. Redirects are not
    included here.
  </summary>
</histogram>

<histogram name="PrefetchProxy.Prefetch.Mainframe.RetryAfter" units="ms"
    expires_after="2024-09-01">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Records the duration of a Retry-After header on a 503 response to a
    mainframe prefetch request.
  </summary>
</histogram>

<histogram name="PrefetchProxy.Prefetch.Mainframe.TotalTime" units="ms"
    expires_after="2027-02-07">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Records the total time taken when prefetching a mainframe HTML resource.
    Recorded for successful non-network error prefetches only.
  </summary>
</histogram>

<histogram name="PrefetchProxy.Prefetch.RedirectChainSize" units="count"
    expires_after="2026-09-27">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    The redirect chain size of a prefetch. This histogram is recorded once for
    each prefetch.
  </summary>
</histogram>

<histogram name="PrefetchProxy.Prefetch.StreamingURLLoaderFinalStatus"
    enum="PrefetchStreamingURLLoaderStatus" expires_after="2027-02-07">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Records the final status of the PrefetchStreamingURLLoader used to request
    the prefetch.

    This is recorded once for each prefetch that is requested using a streaming
    URL loader. It is recorded when the corresponding PrefetchResponseReader is
    deleted which can be when: 1) the URL loader is canceled, 2) the URL loader
    completed serving the prefetch, or 3) the prefetch was deleted and not used.
  </summary>
</histogram>

<histogram name="PrefetchProxy.Proxy.Fallback.NetError" enum="NetErrorCodes"
    expires_after="2025-03-01">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Records the Net Error encountered when Chrome did a fallback from the
    prefetch proxy. Recorded only on fallbacks.

    Warning: this histogram was expired from 2024-04-25 to 2024-10-11; data may
    be missing.
  </summary>
</histogram>

<histogram name="PrefetchProxy.Proxy.RespCode" enum="HttpResponseCode"
    expires_after="2027-01-17">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Warning: this histogram was expired from 2024-03-17 to 2024-08-20; data may
    be missing.

    Records the HTTP response code encountered when connecting to the prefetch
    proxy CONNECT tunnel. Recorded every time Chrome gets CONNECT tunnel
    response headers.
  </summary>
</histogram>

<histogram name="PrefetchProxy.Redirect.NetworkContextStateTransition"
    enum="PrefetchRedirectNetworkContextTransition" expires_after="2025-05-11">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    The network context transition required to handle a redirect while
    prefetching. Prefetches require an isolated network context if user data
    cannot be included in the prefetch. Otherwise the prefetch is made in the
    default network context. This histogram is recorded for every redirect.
  </summary>
</histogram>

<histogram name="PrefetchProxy.Redirect.Result" enum="PrefetchRedirectResult"
    expires_after="2027-02-07">
  <owner>kouhei@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    The result of receiving a redirect while prefetching. This histogram is
    recorded for every redirect.
  </summary>
</histogram>

</histograms>

</histogram-configuration>
