<!--
Copyright 2020 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 Quota 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>

<histogram name="Quota.AgeOfDataInDays" units="days" expires_after="2025-12-07">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    How many kilobytes are how old. Similar to |AgeOfOrigin| except a sample is
    added for each kilobyte of an origin's data. Logged hourly for all origins
    with stored data. Warning: this histogram was expired from 2025/04 to
    2025/06; data may be missing.
  </summary>
</histogram>

<histogram name="Quota.AgeOfOriginInDays" units="days"
    expires_after="2025-12-07">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    How many days it's been since an origin's temporary storage has been
    accessed. Logged hourly for all origins with stored data. Warning: this
    histogram was expired from 2025/04 to 2025/06; data may be missing.
  </summary>
</histogram>

<histogram name="Quota.AvailableDiskSpace" units="MB"
    expires_after="2026-12-27">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Amount of free disk space for the storage directory. Logged at irregular
    intervals.
  </summary>
</histogram>

<histogram name="Quota.AvailableDiskSpace2" units="MB"
    expires_after="2026-12-27">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Amount of free disk space for the storage directory. Logged when collecting
    usage information.
  </summary>
</histogram>

<histogram name="Quota.DatabaseMigration{VersionUpgrades}"
    enum="BooleanSuccess" expires_after="2026-02-09">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Records whether the database migration was successful. Recorded after
    attempting to migrate the database.
  </summary>
  <token key="VersionUpgrades">
    <variant name="FromV10ToV11"/>
  </token>
</histogram>

<histogram name="Quota.DaysSinceLastAccessed" units="days"
    expires_after="2027-03-31">
  <owner>arichiv@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Emitted when the browsing context loads a quota bucket for use and updates
    the last_accessed field in the database.

    Number of days since a quota bucket was accessed. Capped at 400 days as
    buckets are not retained past that point.
  </summary>
</histogram>

<histogram name="Quota.DiskspaceShortage" units="MB" expires_after="2026-06-21">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Difference between acceptable lower limit of diskspace and actual free
    diskspace at beginning of an eviction round. Recorded after every eviction
    round is finished.
  </summary>
</histogram>

<histogram name="Quota.EvictedBucketAccessCount" units="units"
    expires_after="2025-12-07">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    The number of times the evicted bucket was accessed. Logged when the bucket
    is evicted. Replaces Quota.EvictedOriginAccessCount when eviction was per
    origin.
  </summary>
</histogram>

<histogram name="Quota.EvictedBucketDaysSinceAccess" units="units"
    expires_after="2025-12-07">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    The number of days since the evicted bucket was last accessed. Logged when
    the bucket is evicted. Replaces Quota.EvictedOriginDaysSinceAccess when
    eviction was per origin. Warning: this histogram was expired from 2025/01 to
    2025/06; data may be missing.
  </summary>
</histogram>

<histogram name="Quota.EvictedBucketsPerHour" units="buckets"
    expires_after="2025-12-07">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Number of evicted buckets in an hour. Replaces Quota.EvictedOriginPerHour
    when eviction was per origin. Warning: this histogram was expired from
    2024/09 to 2025/06; data may be missing.
  </summary>
</histogram>

<histogram name="Quota.EvictedBytesPerRound" units="MB"
    expires_after="2025-12-07">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Amount of usage used by evicted buckets in an eviction round. Prior to M94,
    evictions were based on per origin instead of per bucket. Warning: this
    histogram was expired from 2024/09 to 2025/06; data may be missing.
  </summary>
</histogram>

<histogram name="Quota.EvictionRoundsPerHour" units="units"
    expires_after="2025-12-07">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Number of eviction rounds in an hour. Warning: this histogram was expired
    from 2020/10 to 2022/06 and from 2025/04 to 2025/06; data may be missing.
  </summary>
</histogram>

<histogram name="Quota.GlobalTemporaryPoolSize" units="MB"
    expires_after="2025-12-07">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    The size of the global temporary storage pool. Logged at irregular
    intervals. Warning: this histogram was expired from 2024/12 to 2025/06; data
    may be missing.
  </summary>
</histogram>

<histogram name="Quota.GlobalUsageOfTemporaryStorage" units="MB"
    expires_after="2025-12-07">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Global usage of temporary storage. Warning: this histogram was expired from
    2024/12 to 2025/06; data may be missing.
  </summary>
</histogram>

<histogram name="Quota.NumberOfEvictedBucketsPerRound" units="units"
    expires_after="2025-04-27">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Number of evicted buckets per round. Warning: this histogram was expired
    from 2025/04 to 2025/06; data may be missing.
  </summary>
</histogram>

<histogram name="Quota.OrphanBucketCount" units="areas"
    expires_after="2027-03-31">
  <owner>arichiv@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Records the amount of orphan (nonce-bound buckets which will never be
    loaded) on QuotaTemporaryStorageEvictor rounds. Starts recording one minute
    after initialization of QuotaDatabase to ensure session restore has
    completed.

    See crbug.com/353555346 for more info.
  </summary>
</histogram>

<histogram name="Quota.PercentDiskAvailable2" units="%"
    expires_after="2027-01-03">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Percentage of the storage device that is free. Logged when collecting usage
    information.
  </summary>
</histogram>

<histogram name="Quota.PercentUsedByOrigin" units="%"
    expires_after="2025-12-07">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Percentage of an origin's quota that is being used by the origin. Logged at
    irregular intervals. Warning: this histogram was expired from 2024/12 to
    2025/06; data may be missing.
  </summary>
</histogram>

<histogram name="Quota.PercentUsedForTemporaryStorage2" units="%"
    expires_after="2025-12-07">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Percentage of the storage device that is being use for temporary storage.
    Logged when collecting usage information. Warning: this histogram was
    expired from 2024/12 to 2025/06; data may be missing.
  </summary>
</histogram>

<histogram name="Quota.QuotaDatabaseDisabled"
    enum="QuotaDatabaseDisabledReason" expires_after="2026-12-07">
  <owner>leimy@chromium.org</owner>
  <owner>evanstade@microsoft.com</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Records at which step the QuotaDatabase failed to bootstrap. Warning: this
    histogram was expired from 2024/07 to 2025/06; data may be missing.
  </summary>
</histogram>

<histogram name="Quota.QuotaDatabaseReset" enum="QuotaDatabaseResetReason"
    expires_after="2025-12-07">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Records the reason the QuotaDatabase was reset to understand how frequently
    and why this happens. This will inform us on how we should implement data
    recovery for storage data when the QuotaDatabase is reset.
  </summary>
</histogram>

<histogram name="Quota.QuotaForOrigin" units="MB" expires_after="2025-12-07">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    The quota value computed for an origin using temporary storage. Logged at
    irregular intervals. (In the process of writing new data, storage systems
    consult the quota system for &quot;usage and quota&quot; to determine if
    there is sufficient space available for the new data. This value is logged
    at the time of that consultation. The frequency is dependent on how
    individual websites use the various storage apis.) Warning: this histogram
    was expired from 2024/12 to 2025/06; data may be missing.
  </summary>
</histogram>

<histogram name="Quota.StaleBucketCount" units="areas"
    expires_after="2027-03-31">
  <owner>arichiv@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Records the amount of stale (400 days since last access or write and not
    persistent) storage buckets on QuotaTemporaryStorageEvictor rounds.

    Emitted without knowledge of eviction success or failure.

    See crbug.com/40281870 for more info.
  </summary>
</histogram>

<histogram name="Quota.TimeSpentToAEvictionRound" units="units"
    expires_after="2026-10-12">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Time spent to an eviction round. Warning: this histogram was expired from
    2018/08 to 2022/06 and from 2025/05 to 2025/06; data may be missing.
  </summary>
</histogram>

<histogram name="Quota.TotalBucketCount" units="buckets"
    expires_after="2025-12-07">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Total number of entries in the QuotaDatabase buckets table for a profile.
    Logged hourly. Warning: this histogram was expired from 2025/04 to 2025/06;
    data may be missing.
  </summary>
</histogram>

<histogram name="Quota.TotalDiskSpace" units="MB" expires_after="2027-02-07">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Total disk space for the storage directory. Logged at irregular intervals.
  </summary>
</histogram>

<histogram name="Quota.TotalDiskSpaceIsZero" enum="BooleanVolumeZero"
    expires_after="2026-06-07">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Whether base::SysInfo::AmountOfTotalDiskSpace() returned zero or a negative
    number to the quota system. Logged whenever something is pinging the system
    for quota or device info.
  </summary>
</histogram>

<histogram name="Quota.UsageByOrigin" units="MB" expires_after="2025-12-07">
  <owner>ayui@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Disk space (in MB) currently used by an origin. Logged hourly.
  </summary>
</histogram>

</histograms>

</histogram-configuration>
