<!--
Copyright 2026 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 CBOR 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="CBOR.Read.Duration.{ParserBackend}" units="microseconds"
    expires_after="2026-11-06">
  <owner>zgroza@chromium.org</owner>
  <owner>src/components/cbor/OWNERS</owner>
  <summary>
    Records the total elapsed time in microseconds for cbor::Reader::Read().
    Emitted once for every call to cbor::Reader::Read(). This metric is only
    reported for clients with high-resolution clocks. {ParserBackend}
  </summary>
  <token key="ParserBackend">
    <variant name="Cpp" summary="Uses the C++ cbor parser."/>
    <variant name="Rust"
        summary="Uses the Rust cbor parser and includes both Rust parsing and
                 C++ Value conversion."/>
  </token>
</histogram>

<histogram name="CBOR.Read.Size.{ParserBackend}" units="bytes"
    expires_after="2026-11-06">
  <owner>zgroza@chromium.org</owner>
  <owner>src/components/cbor/OWNERS</owner>
  <summary>
    Records the size of the payload in bytes provided to cbor::Reader::Read().
    This provides context for CBOR.Read.Duration. Emitted once for every call to
    cbor::Reader::Read(). {ParserBackend}
  </summary>
  <token key="ParserBackend">
    <variant name="Cpp" summary="Uses the C++ cbor parser."/>
    <variant name="Rust" summary="Uses the Rust cbor parser."/>
  </token>
</histogram>

<histogram name="CBOR.ReadResult.{ParserBackend}" enum="CBORDecoderError"
    expires_after="2026-11-06">
  <owner>zgroza@chromium.org</owner>
  <owner>src/components/cbor/OWNERS</owner>
  <summary>
    Records the outcome (success or specific decoder error) of CBOR parsing
    operations. Emitted once for every call to cbor::Reader::Read().
    {ParserBackend}
  </summary>
  <token key="ParserBackend">
    <variant name="Cpp" summary="Uses the C++ cbor parser."/>
    <variant name="Rust" summary="Uses the Rust cbor parser."/>
  </token>
</histogram>

</histograms>

</histogram-configuration>
