<!--
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 Event 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="ScrollEventType">
  <variant name="FirstGestureScrollUpdate"
      summary="gesture-scroll-update events that are the first one in a
               scroll sequence"/>
  <variant name="GestureScrollBegin" summary="gesture-scroll-begin events"/>
  <variant name="GestureScrollEnd" summary="gesture-scroll-end events"/>
  <variant name="GestureScrollUpdate"
      summary="gesture-scroll-update events that are non-inertial (i.e. not
               generated due to a user fling) and not the first one in a
               scroll sequence"/>
  <variant name="InertialGestureScrollEnd"
      summary="gesture-scroll-end events that are inertial (i.e. generated
               due to a user fling)"/>
  <variant name="InertialGestureScrollUpdate"
      summary="gesture-scroll-update events that are inertial (i.e. generated
               due to a user fling)"/>
</variants>

<variants name="ScrollInputType">
  <variant name="Autoscroll" summary="autoscroll"/>
  <variant name="Scrollbar" summary="scrollbar"/>
  <variant name="Touchscreen" summary="touchscreen"/>
  <variant name="Wheel" summary="mouse wheel or touchpad"/>
</variants>

<variants name="ScrollJankOperator">
  <variant name="Max" summary="maximum number of vsyncs a frames was delayed"/>
  <variant name="Sum" summary="sum of missed vsyncs across all frames"/>
</variants>

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

<variants name="ScrollJankReasonV4">
  <variant name="" summary="any scroll jank reason"/>
  <variant name=".MissedVsyncAtStartOfFling"
      summary="Chrome missed one or more VSyncs during the transition from a
               fast regular scroll to a fling (violates fling continuity
               rule)"/>
  <variant name=".MissedVsyncDueToDeceleratingInputFrameDelivery"
      summary="Chrome missed one or more VSyncs due to decelerating
               input→frame delivery (violates running consistency rule)"/>
  <variant name=".MissedVsyncDuringFastScroll"
      summary="Chrome missed one or more VSyncs in the middle of a fast
               regular scroll. (violates fast scroll continuity rule)"/>
  <variant name=".MissedVsyncDuringFling"
      summary="Chrome missed one or more VSyncs in the middle of a fast
               regular scroll (violates fling continuity rule)"/>
</variants>

<!-- LINT.ThenChange(//cc/metrics/scroll_jank_v4_result.h:JankReason) -->

<histogram name="Event.Android.GestureScrollEnd.TimeSpentInBinder" units="ms"
    expires_after="2027-01-17">
  <owner>nafisabedin@google.com</owner>
  <owner>yfriedman@chromium.org</owner>
  <summary>
    Android-only. Records the time spent handling Binder IPCs between a
    GestureScrollBegin and the corresponding GestureScrollEnd event. Recorded
    when a GestureScrollEnd is received.

    The underlying mechanism used to determine this relies on undocumented
    Android APIs, meaning that it may break in the future.
  </summary>
</histogram>

<histogram name="Event.Android.GestureScrollEnd.TotalBinderTransactions"
    units="counts" expires_after="2027-01-17">
  <owner>nafisabedin@google.com</owner>
  <owner>yfriedman@chromium.org</owner>
  <summary>
    Android-only. Records the number of Binder IPCs made between a
    GestureScrollBegin and the corresponding GestureScrollEnd event. Recorded
    when a GestureScrollEnd is received.

    The underlying mechanism used to determine this relies on undocumented
    Android APIs, meaning that it may break in the future.
  </summary>
</histogram>

<histogram name="Event.AndroidActionDown.ToolType" enum="MotionEventToolType"
    expires_after="never">
<!-- expires-never: Needed for long-term usage tracking for different types of
     pointers. -->

  <owner>mustaq@chromium.org</owner>
  <owner>nzolghadr@chromium.org</owner>
  <summary>
    Tracks the number of Android MotionEvents with ACTION_DOWN or
    ACTION_POINTER_DOWN or ACTION_BUTTON_PRESS for each ToolType (unknown,
    finger, mouse or stylus).

    Team: input-dev@chromium.org.
  </summary>
</histogram>

<histogram
    name="Event.DownEventCount.PerInputFormFactorDestinationCombination2"
    enum="DownEventInputFormFactorDestinationCombination2"
    expires_after="2027-02-07">
  <owner>tbuckley@chromium.org</owner>
  <summary>
    The number of down events received per destination, input and form factor
    combination.

    Input is down events generated by mouse/touch/stylus. Form factor is down
    events generated by clamshell/touchviewLandscape/touchviewPortrait.
    Destination: Every down event that is targeted to each destination will be
    counted including those that don't have an effect. For example: Tapping on a
    disabled button inside the browser frame will be treated as down events on
    browser window.
  </summary>
</histogram>

<histogram name="Event.DragDrop.Surface" enum="DragAndDropSurface"
    expires_after="2027-01-03">
  <owner>mustaq@chromium.org</owner>
  <owner>gastonr@microsoft.com</owner>
  <owner>gerchiko@microsoft.com</owner>
  <owner>input-dev@chromium.org</owner>
  <summary>
    Records the completion of a drag and drop operation and the surface on which
    the drag started and the drop occurred. Only drop operations that produced
    an effect will be recorded. Meaning, only when the result of a drop is
    kMove, kLink or kCopy will this histogram be fired. A drag can start on the
    browser, or outside of it, and can end on either the same page, a different
    page on the same browser or an external surface within the OS. Drags that
    started and ended outside of the browser are not recorded, even if the drag
    went over the browser at any point.

    Currently only recorded in Aura platforms.
  </summary>
</histogram>

<histogram name="Event.DragDrop.Tool" enum="DragAndDropToolType"
    expires_after="2026-10-04">
  <owner>mustaq@chromium.org</owner>
  <owner>gastonr@microsoft.com</owner>
  <owner>gerchiko@microsoft.com</owner>
  <owner>input-dev@chromium.org</owner>
  <summary>
    Records the completion of a drag and drop operation using the enumerated
    tool as the device for the drag. The tool used for drags is not discernible
    when the drag is initiated outside of the browser's window, so those drags
    will be recorded as using the unknown tool.
  </summary>
</histogram>

<histogram name="Event.GestureCreated" enum="UIEventType"
    expires_after="2025-06-22">
  <owner>kuscher@google.com</owner>
  <owner>input-dev@chromium.org</owner>
  <summary>
    The gesture-events recognized and dispatched by the browser gesture
    recognizer. This replaces Ash.GestureCreated, which did not record events on
    Android and Windows.

    Note: this metric was expired from 2020-03-01 to 2023-04-04.
  </summary>
</histogram>

<histogram name="Event.GestureScrollEnd.BrowserCompositorFrame.Count"
    units="counts" expires_after="2027-01-24">
  <owner>peilinwang@google.com</owner>
  <owner>woa-performance-team@google.com</owner>
  <summary>
    Records the number of compositor frames submitted by browser main between a
    GestureScrollBegin and the corresponding GestureScrollEnd event. Recorded
    when a GestureScrollEnd is received.
  </summary>
</histogram>

<histogram name="Event.GestureTimeout" enum="UIEventType"
    expires_after="2027-03-12">
  <owner>anandrv@chromium.org</owner>
  <owner>clank-performance-team@google.com</owner>
  <summary>
    The type of gesture that was timed out. A gesture times out when a touch
    event (e.g., touchstart) is sent to the renderer process, but the renderer
    takes too long to handle it. When the timeout delay is reached, the browser
    cancels the touch sequence to ensure the UI remains responsive and logs the
    gesture event that was dropped.
  </summary>
</histogram>

<histogram name="Event.InputEventPrediction.Scroll.Frame{ScoreType}"
    units="pixels" expires_after="2024-12-30">
  <owner>flackr@chromium.org</owner>
  <owner>input-dev@chromium.org</owner>
  <summary>
    NOTE: this metric was expired from M97 to 2023-03-14. Overshoot distance in
    pixels between a predicted scroll position and the corresponding
    interpolated real scroll position that occurred at the frame time.

    The difference between {ScoreType} and Frame{ScoreType} is the former uses
    prediction time and the later uses frame time.

    Team: input-dev@chromium.org.
  </summary>
  <token key="ScoreType">
    <variant name="OverPrediction" summary="Positive score values"/>
    <variant name="PredictionScore" summary="Score abolute value"/>
    <variant name="UnderPrediction" summary="Negative score values"/>
  </token>
</histogram>

<histogram name="Event.InputEventPrediction.Scroll.{ScoreType}" units="pixels"
    expires_after="2025-01-26">
  <owner>flackr@chromium.org</owner>
  <owner>input-dev@chromium.org</owner>
  <summary>
    NOTE: this metric was expired from M97 to 2023-03-14. Overshoot distance in
    pixels between a predicted scroll position and the corresponding
    interpolated real scroll position that occurred at the frame time.

    Team: input-dev@chromium.org.
  </summary>
  <token key="ScoreType">
    <variant name="OverPrediction" summary="Positive score values"/>
    <variant name="PredictionScore" summary="Score abolute value"/>
    <variant name="UnderPrediction" summary="Negative score values"/>
  </token>
</histogram>

<histogram name="Event.InputEventPrediction.{InteractionType}.PredictionJitter"
    units="pixels" expires_after="2027-01-03">
  <owner>amanvr@google.com</owner>
  <owner>jonross@chromium.org</owner>
  <owner>flackr@chromium.org</owner>
  <owner>input-dev@chromium.org</owner>
  <summary>
    NOTE: this metric was expired from M97 to 2023-03-14 and from 2024-03-13 to
    2024-06-28. Euclidean distance in pixels between two successive variations
    of {InteractionType} deltas which are the difference between a predicted
    position and its corresponding interpolated real position that occurred at
    prediction time.

    Team: input-dev@chromium.org.
  </summary>
  <token key="InteractionType">
    <variant name="Fling"/>
    <variant name="Scroll"/>
  </token>
</histogram>

<histogram name="Event.InputEventPrediction.{InteractionType}.VisualJitter"
    units="pixels" expires_after="2027-01-03">
  <owner>amanvr@google.com</owner>
  <owner>jonross@chromium.org</owner>
  <owner>flackr@chromium.org</owner>
  <owner>input-dev@chromium.org</owner>
  <summary>
    NOTE: this metric was expired from M97 to 2023-03-14 and from 2024-03-13 to
    2024-06-28. Euclidean distance in pixels between two successive variations
    of {InteractionType} deltas which are the difference between a predicted
    position and the interpolated real position that occurred at frame time.

    Team: input-dev@chromium.org.
  </summary>
  <token key="InteractionType">
    <variant name="Fling"/>
    <variant name="Scroll"/>
  </token>
</histogram>

<histogram name="Event.Jank.PredictorJankyFramePercentage2" units="%"
    expires_after="2026-12-27">
  <owner>jonross@chromium.org</owner>
  <owner>woa-performance@google.com</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    A frame is deemed janky if an irregular jump in screen displacement occured
    in consecutive frames, this metric is the percentage of those janky frames
    per 64 produced frames and is only emitted if a scroll has 64 frames in a
    sequence. This metric is used to asses the scrolling prediction performance
    as the scroll predictor should smooth out those irregular jumps.

    For more details about this metric, please check
    http://doc/1Y0u0Tq5eUZff75nYUzQVw6JxmbZAW9m64pJidmnGWsY.

    Example of a slow scroll: https://youtube.com/shorts/K1ZhyjYr0No

    Example of a fast scroll: https://youtube.com/shorts/dGj6XTD-PYA
  </summary>
</histogram>

<histogram
    name="Event.Jank.ScrollUpdate.{ScrollSpeed}.{VsyncStatus}.FrameAboveJankyThreshold2"
    units="ratio * 100" expires_after="2027-02-07">
  <owner>jonross@chromium.org</owner>
  <owner>woa-performance@google.com</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    This metric is the ratio between a larger screen displacement divided by a
    following small screen displacement {ScrollSpeed}. If the larger screen
    displacement was deemed janky given the predictor performance, and is only
    emitted if there is {VsyncStatus}. This metric is used to asses the
    scrolling prediction performance as the scroll predictor should smooth out
    those irregular jumps.

    For more details about this metric, please check
    http://doc/1Y0u0Tq5eUZff75nYUzQVw6JxmbZAW9m64pJidmnGWsY.
  </summary>
  <token key="VsyncStatus">
    <variant name="MissedVsync" summary="a missed vsync"/>
    <variant name="NoMissedVsync" summary="no missed vsync"/>
  </token>
  <token key="ScrollSpeed">
    <variant name="FastScroll"
        summary="offset by 1.2, the jank threshold for fast scrolls.
                 |d_large/d_small - 1.2|"/>
    <variant name="SlowScroll"
        summary="offset by 1.4, the jank threshold for slow scrolls.
                 |d_large/d_small - 1.4|"/>
  </token>
</histogram>

<histogram name="Event.Latency.OS2{EventType}" units="ms"
    expires_after="2027-01-10">
  <owner>flackr@chromium.org</owner>
  <owner>joenotcharles@google.com</owner>
  <owner>input-dev@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Time between input event received by OS and sent to Chrome, recorded for
    each event when it is received by Chrome. Replaced Event.Latency.OS which
    was calculated incorrectly on Windows.

    Warning: On Windows, the timestamps of most events come from a clock with a
    several msec resolution so will have an abnormal distribution even when
    TimeTicks::IsHighResolution returns true. The exception is touch events
    which usually come from the high-resolution clock when
    TimeTicks::IsHighResolution returns true.

    Note: As of May 29 2024 (M127), the calculation has been updated to be
    optimistic about the low-frequency clock on Windows (0ms if &lt;= 1x 16ms
    tick), hence a -16ms shift is expected in the distribution.
  </summary>
  <token key="EventType">
    <variant name=""/>
    <variant name=".KEY_PRESSED"/>
    <variant name=".MOUSE_PRESSED"/>
    <variant name=".MOUSE_WHEEL"/>
    <variant name=".TOUCH_MOVED"/>
    <variant name=".TOUCH_PRESSED"/>
    <variant name=".TOUCH_RELEASED"/>
  </token>
</histogram>

<histogram name="Event.Latency.ScrollBegin.Touch.AverageLagPresentation"
    units="pixels" expires_after="2027-04-01">
  <owner>flackr@chromium.org</owner>
  <owner>gerchiko@microsoft.com</owner>
  <owner>input-dev@chromium.org</owner>
  <summary>
    Measures an average distance that represents how the page sticks to the
    finger when user scrolls. Only reports touch scrolling. See
    https://docs.google.com/document/d/154jddNiKtxELBvrjLz9v6A7sA1J3iwQQzySHgtY12Oo/

    This is the lag observed in processing the Gesture Scroll Begin Event. In
    each touch interaction there is a GSB followed by multiple Gesture Scroll
    Updates, which are separately logged by
    Event.Latency.ScrollUpdate.Touch.AverageLagPresentation.

    Note: This histogram was expired from 2022-05-01 to 2023-06-20.

    Team: input-dev@chromium.org.
  </summary>
</histogram>

<histogram
    name="Event.Latency.ScrollBegin.Touch.AverageLagPresentation.NoPrediction"
    units="pixels" expires_after="2027-04-01">
  <owner>flackr@chromium.org</owner>
  <owner>gerchiko@microsoft.com</owner>
  <owner>input-dev@chromium.org</owner>
  <summary>
    Measures an average distance that represents how the page sticks to the
    finger when user scrolls if prediction was disabled. Only reports touch
    scrolling. See
    https://docs.google.com/document/d/154jddNiKtxELBvrjLz9v6A7sA1J3iwQQzySHgtY12Oo/

    This is the lag observed in processing the Gesture Scroll Begin Event. In
    each touch interaction there is a GSB followed by multiple Gesture Scroll
    Updates, which are separately logged by
    Event.Latency.ScrollUpdate.Touch.AverageLagPresentation.

    Note: This histogram was expired from 2022-11-23 to 2023-06-20.

    Team: input-dev@chromium.org.
  </summary>
</histogram>

<histogram name="Event.Latency.ScrollUpdate.Touch.AverageLagPresentation"
    units="pixels" expires_after="2027-04-01">
  <owner>flackr@chromium.org</owner>
  <owner>gerchiko@microsoft.com</owner>
  <owner>input-dev@chromium.org</owner>
  <summary>
    Measures an average distance that represents how the page sticks to the
    finger when user scrolls. Only reports touch scrolling. See
    https://docs.google.com/document/d/154jddNiKtxELBvrjLz9v6A7sA1J3iwQQzySHgtY12Oo/

    This is the lag observed in processing the Gesture Scroll Updates occurring
    in the lifetime of a scroll interaction.

    Note: This histogram was expired from 2022-12-25 to 2023-06-20.

    Team: input-dev@chromium.org.
  </summary>
</histogram>

<histogram
    name="Event.Latency.ScrollUpdate.Touch.AverageLagPresentation.NoPrediction"
    units="pixels" expires_after="2027-04-01">
  <owner>flackr@chromium.org</owner>
  <owner>gerchiko@microsoft.com</owner>
  <owner>input-dev@chromium.org</owner>
  <summary>
    Measures an average distance that represents how the page sticks to the
    finger when user scrolls if prediction was disabled. Only reports touch
    scrolling. See
    https://docs.google.com/document/d/154jddNiKtxELBvrjLz9v6A7sA1J3iwQQzySHgtY12Oo/

    This is the lag observed in processing the Gesture Scroll Updates occurring
    in the lifetime of a scroll interaction.

    Note: This histogram was expired from 2022-11-23 to 2023-06-12.

    Team: input-dev@chromium.org.
  </summary>
</histogram>

<histogram
    name="Event.Latency.ScrollUpdate.Touch.AverageLagPresentation.RemainingLagPercentage"
    units="%" expires_after="2027-04-01">
  <owner>flackr@chromium.org</owner>
  <owner>gerchiko@microsoft.com</owner>
  <owner>input-dev@chromium.org</owner>
  <summary>
    Percentage of touch lag that prediction wasn't able to remove.

    This is the ratio (Lag_with_prediction)/(Lag_without_prediction). Lag is the
    average distance between the finger and page positons during touch
    scrolling.

    0% means all the lag existing before prediction was removed. 100% means that
    prediction had no impact. Greater than 100% means that prediction introduced
    more lag.

    This metric doesn't distinguish between OverPrediction and UnderPrediction.
    A same absolute value of OverPrediction or UnderPrediction will result in
    the same RemainingLagPercentage value.

    Lag_with_prediction =
    Event.Latency.ScrollUpdate.Touch.AverageLagPresentation
    Lag_without_prediction =
    Event.Latency.ScrollUpdate.Touch.AverageLagPresentation.NoPrediction

    Note: This histogram was expired from 2022-11-23 to 2023-06-20.

    Team: input-dev@chromium.org.
  </summary>
</histogram>

<histogram
    name="Event.Latency.ScrollUpdate.Touch.AverageLagPresentation.{PredictionImpact}"
    units="pixels" expires_after="2027-04-01">
  <owner>flackr@chromium.org</owner>
  <owner>gerchiko@microsoft.com</owner>
  <owner>input-dev@chromium.org</owner>
  <summary>
    Improvement of prediction in touch lag. It is defined as
    (Lag_without_prediction - Lag_with_prediction).

    Lag is the distance between the finger position and the rendered position.

    When positive, prediction improves touch performance (reduces lag). When
    negative, prediction worsens touch performance (increases lag).

    The duration of the interaction/interval is either 1s, or the time from when
    the user starts scrolling to lifting the finger, whichever is smaller.

    This metric uses directionless distances, therefore it doesn't distinguish
    between OverPrediction and UnderPrediction. A same absolute value of
    OverPrediction or UnderPrediction will result in the same PredictionImpact
    value.

    Lag_with_prediction =
    Event.Latency.ScrollUpdate.Touch.AverageLagPresentation
    Lag_without_prediction =
    Event.Latency.ScrollUpdate.Touch.AverageLagPresentation.NoPrediction

    Note: This histogram was expired from 2022-11-23 to 2023-06-20.

    Team: input-dev@chromium.org.
  </summary>
  <token key="PredictionImpact">
    <variant name="PredictionNegative" summary="Negative impact values"/>
    <variant name="PredictionPositive" summary="Positive impact values"/>
  </token>
</histogram>

<histogram name="Event.MaxDragDistance.{ToolType}" units="dips"
    expires_after="never">
<!-- expires-never: Needed for long-term tracking of dragging vs clicking behavior. -->

  <owner>mustaq@chromium.org</owner>
  <owner>input-dev@chromium.org</owner>
  <summary>
    The maximum Euclidean distance (in DIPs, device independent pixels) a
    single-pointer gesture travels from its starting position during the period
    the gesture has been active. The histogram is measured separately for every
    pointer type that can be used in gesture recognition: finger, and pen in
    drawing/eraser mode. The type names used here follow the corresponding
    labels in |MotionEvent.ToolType|.
  </summary>
  <token key="ToolType">
    <variant name="ERASER"/>
    <variant name="FINGER"/>
    <variant name="STYLUS"/>
  </token>
</histogram>

<histogram name="Event.Scroll.{ScrollInputType}" units="ms"
    expires_after="2027-01-03">
  <owner>kraskevich@google.com</owner>
  <owner>woa-performance-team@google.com</owner>
  <summary>
    Tracks total duration of scrolls for {ScrollInputType} input type.
  </summary>
</histogram>

<histogram name="Event.ScrollJank.DelayedFramesPercentage.FixedWindow"
    units="%" expires_after="never">
<!-- expires-never: guiding metric (internal: go/chrome-browser-guiding-metrics) -->

  <owner>kartarsingh@google.com</owner>
  <owner>jonross@chromium.org</owner>
  <owner>woa-performance-team@google.com</owner>
  <owner>chrome-analysis-team@google.com</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    The percentage of frames not presented during a scroll or a fling[1],
    meaning frame production took longer than expected and the frame was
    skipped.

    This metric is different from traditional graphics smoothness metrics as it
    considers performance degradation on all threads and processes including
    Browser and IO, unlike graphics' smoothness metrics which focus on the core
    graphics pipeline (Renderer/GPU).

    This metric is only recorded when 64 frames are presented, for example if a
    scroll only has 12 frames, the next scroll has 40 frames and the scroll
    after has 12 frames, the metric only will be emitted after the 3rd scroll.
    This means the last incomplete window might not get reported as the browser
    terminates.

    For more details about this metric, please check
    http://doc/1Y0u0Tq5eUZff75nYUzQVw6JxmbZAW9m64pJidmnGWsY

    This histogram is of special interest to the chrome-analysis-team@.

    Do not change its semantics or retire it without talking to them first.

    [1]Fling is a finger boosted scroll, meaning the screen is moving after the
    user has accelerated their finger on the screen and removed it.
  </summary>
</histogram>

<histogram name="Event.ScrollJank.DelayedFramesPercentage.PerScroll" units="%"
    expires_after="2027-01-31">
  <owner>kartarsingh@google.com</owner>
  <owner>jonross@chromium.org</owner>
  <owner>woa-performance-team@google.com</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    A frame is deemed janky during a scroll if there was no presented frame in
    the previous vsync, and the current frame contains input that was not
    presented during the missed frame. Missed input is determined by comparing
    the timestamp of the earliest input of the current frame, to that of the
    last input of the previously presented frame. If the delta of the timestamps
    is less than a vsync + vsync/2, then the input is considered to have been
    intended for the missed frame. This metric reports the percentage of delayed
    frames within a scroll.

    For more details about this metric, please check
    http://doc/1Y0u0Tq5eUZff75nYUzQVw6JxmbZAW9m64pJidmnGWsY
  </summary>
</histogram>

<histogram name="Event.ScrollJank.DelayedFramesPercentage4.FixedWindow{Reason}"
    units="%" expires_after="2027-01-31">
  <owner>petrcermak@chromium.org</owner>
  <owner>kartarsingh@google.com</owner>
  <owner>jonross@chromium.org</owner>
  <owner>woa-performance-team@google.com</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    NOTE: This 'scroll jank v4 metric' is a new refined version of
    Event.ScrollJank.DelayedFramesPercentage.FixedWindow. This new metric aims
    to address the old metric's shortcomings and eventually replace it.

    The percentage of frames in a window of 64 frames containing (regular and/or
    inertial[1]) scroll updates which Chrome didn't present on time, meaning
    frame production took longer than expected and Chrome consequently missed
    (didn't present any inputs in) a VSync. This metric considers a frame
    delayed if it violates any of the following three rules:

    1. Running consistency: Chrome's input→frame delivery must not slow down to
    the point that Chrome misses a VSync in which Chrome would have been able to
    present an input had it maintained consistent input→frame delivery.

    2. Fast scroll continuity: There must be no missed VSyncs between
    consecutive frames containing scroll updates with absolute total raw scroll
    delta greater than or equal to 3 pixels.

    3. Fling continuity: There must be no missed VSyncs during the transition
    from a regular scroll to a fling UNLESS the regular scroll is slow with
    absolute total raw scroll delta less than 3 pixels per frame. There must
    also be no missed VSyncs between consecutive inertial frames EXCEPT towards
    the end of a fling if the absolute total raw scroll delta drops below 0.2
    pixels per frame.

    This metric is different from traditional graphics smoothness metrics as it
    considers performance degradation on all threads and processes including
    Browser and IO, unlike graphics' smoothness metrics which focus on the core
    graphics pipeline (Renderer/GPU).

    This metric is only recorded when 64 frames are presented, for example if a
    scroll only has 12 frames, the next scroll has 40 frames and the scroll
    after has 12 frames, the metric only will be emitted after the 3rd scroll.
    This means the last incomplete window might not get reported as the browser
    terminates. This metric emits zero in the case when no frames were delayed
    in a window of 64 frames.

    For more details about this metric, please check
    https://docs.google.com/document/d/1AaBvTIf8i-c-WTKkjaL4vyhQMkSdynxo3XEiwpofdeA

    [1] An inertial scroll (aka a fling) is a finger boosted scroll, meaning the
    screen is moving after the user has accelerated their finger on the screen
    and removed it.
  </summary>
  <token key="Reason" variants="ScrollJankReasonV4"/>
</histogram>

<histogram name="Event.ScrollJank.DelayedFramesPercentage4.PerScroll" units="%"
    expires_after="2027-01-24">
  <owner>petrcermak@chromium.org</owner>
  <owner>kartarsingh@google.com</owner>
  <owner>jonross@chromium.org</owner>
  <owner>woa-performance-team@google.com</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    NOTE: This 'scroll jank v4 metric' is a new refined version of
    Event.ScrollJank.DelayedFramesPercentage.PerScroll. This new metric aims to
    address the old metric's shortcomings and eventually replace it.

    The percentage of frames in a (regular and/or inertial[1]) scroll which
    Chrome didn't present on time, meaning frame production took longer than
    expected and Chrome consequently missed (didn't present any inputs in) a
    VSync. This metric considers a frame delayed if it violates any of the
    following three rules:

    1. Running consistency: Chrome's input→frame delivery must not slow down to
    the point that Chrome misses a VSync in which Chrome would have been able to
    present an input had it maintained consistent input→frame delivery.

    2. Fast scroll continuity: There must be no missed VSyncs between
    consecutive frames containing scroll updates with absolute total raw scroll
    delta greater than or equal to 3 pixels.

    3. Fling continuity: There must be no missed VSyncs during the transition
    from a regular scroll to a fling UNLESS the regular scroll is slow with
    absolute total raw scroll delta less than 3 pixels per frame. There must
    also be no missed VSyncs between consecutive inertial frames EXCEPT towards
    the end of a fling if the absolute total raw scroll delta drops below 0.2
    pixels per frame.

    This metric is different from traditional graphics smoothness metrics as it
    considers performance degradation on all threads and processes including
    Browser and IO, unlike graphics' smoothness metrics which focus on the core
    graphics pipeline (Renderer/GPU).

    This metric emits zero in the case when no frames were delayed in a scroll.

    For more details about this metric, please check
    https://docs.google.com/document/d/1AaBvTIf8i-c-WTKkjaL4vyhQMkSdynxo3XEiwpofdeA

    [1] An inertial scroll (aka a fling) is a finger boosted scroll, meaning the
    screen is moving after the user has accelerated their finger on the screen
    and removed it.
  </summary>
</histogram>

<histogram name="Event.ScrollJank.EmptyGestureScrollUpdateFrame" enum="Boolean"
    expires_after="2026-12-27">
  <owner>oksamyt@google.com</owner>
  <owner>woa-performance-team@google.com</owner>
  <summary>
    Whether an empty gesture scroll update caused a frame to be produced when it
    is the only input (as a result of resampling).
  </summary>
</histogram>

<histogram name="Event.ScrollJank.FrameStageScrollIdBasedCalculationIssues"
    enum="FrameStageScrollIdBasedCalculationIssues" expires_after="2027-01-10">
  <owner>petrcermak@chromium.org</owner>
  <owner>kartarsingh@google.com</owner>
  <owner>jonross@chromium.org</owner>
  <owner>woa-performance-team@google.com</owner>
  <summary>
    The issues encountered by the scroll-ID-based implementation of
    `cc::ScrollJankV4FrameStageCalculator` when processing scroll events in a
    single frame. Only emitted for frames which contain at least one GSU.
  </summary>
</histogram>

<histogram name="Event.ScrollJank.MissedVsyncs.PerFrame" units="counts"
    expires_after="2027-01-17">
  <owner>kartarsingh@google.com</owner>
  <owner>jonross@chromium.org</owner>
  <owner>woa-performance-team@google.com</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    A frame is deemed janky during a scroll if there was no presented frame in
    the previous vsync, and the current frame contains input that was not
    presented during the missed frame. Missed input is determined by comparing
    the timestamp of the earliest input of the current frame, to that of the
    last input of the previously presented frame. If the delta of the timestamps
    is less than a vsync + vsync/2, then the input is considered to have been
    intended for the missed frame. This metric counts number of vsyncs the frame
    was delayed by(which could be zero). The metric gets reported for every
    frame.

    Please see Event.ScrollJank.MissedVsyncs* for other related histograms
    aggregated over a fixed window and emitted once per window.

    For more details about this metric, please check
    http://doc/1Y0u0Tq5eUZff75nYUzQVw6JxmbZAW9m64pJidmnGWsY
  </summary>
</histogram>

<histogram name="Event.ScrollJank.MissedVsyncs{Operator}.FixedWindow"
    units="counts" expires_after="2027-01-03">
  <owner>kartarsingh@google.com</owner>
  <owner>jonross@chromium.org</owner>
  <owner>woa-performance-team@google.com</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    A frame is deemed janky during a scroll if there was no presented frame in
    the previous vsync, and the current frame contains input that was not
    presented during the missed frame. Missed input is determined by comparing
    the timestamp of the earliest input of the current frame, to that of the
    last input of the previously presented frame. If the delta of the timestamps
    is less than a vsync + vsync/2, then the input is considered to have been
    intended for the missed frame. This metric reports the {Operator} in window
    of size 64. Metric emits zeros as well i.e. the case when no frames were
    delayed.

    Please see Event.ScrollJank.MissedVsyncs.PerFrame for unaggregated version
    of this histogram.

    For more details about this metric, please check
    http://doc/1Y0u0Tq5eUZff75nYUzQVw6JxmbZAW9m64pJidmnGWsY
  </summary>
  <token key="Operator" variants="ScrollJankOperator"/>
</histogram>

<histogram name="Event.ScrollJank.MissedVsyncs{Operator}.PerScroll"
    units="counts" expires_after="2027-01-03">
  <owner>kartarsingh@google.com</owner>
  <owner>jonross@chromium.org</owner>
  <owner>woa-performance-team@google.com</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    A frame is deemed janky during a scroll if there was no presented frame in
    the previous vsync, and the current frame contains input that was not
    presented during the missed frame. Missed input is determined by comparing
    the timestamp of the earliest input of the current frame, to that of the
    last input of the previously presented frame. If the delta of the timestamps
    is less than a vsync + vsync/2, then the input is considered to have been
    intended for the missed frame. This metric reports the {Operator} in scroll.
    Metric emits zeros as well i.e. the case when no frames were delayed.

    Please see Event.ScrollJank.MissedVsyncs.PerFrame for unaggregated version
    of this histogram.

    For more details about this metric, please check
    http://doc/1Y0u0Tq5eUZff75nYUzQVw6JxmbZAW9m64pJidmnGWsY
  </summary>
  <token key="Operator" variants="ScrollJankOperator"/>
</histogram>

<histogram name="Event.ScrollJank.MissedVsyncs{Operator}4.FixedWindow"
    units="counts" expires_after="2027-01-31">
  <owner>petrcermak@chromium.org</owner>
  <owner>kartarsingh@google.com</owner>
  <owner>jonross@chromium.org</owner>
  <owner>woa-performance-team@google.com</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    NOTE: This 'scroll jank v4 metric' is a new refined version of
    Event.ScrollJank.MissedVsyncs{Operator}.FixedWindow. This new metric aims to
    address the old metric's shortcomings and eventually replace it.

    The {Operator} over the number of VSyncs in a window of 64 frames containing
    (regular and/or inertial[1]) scroll updates which Chrome missed (didn't
    present any inputs in) because it didn't present a frame on time. This
    metric considers a frame delayed if it violates any of the following three
    rules:

    1. Running consistency: Chrome's input→frame delivery must not slow down to
    the point that Chrome misses a VSync in which Chrome would have been able to
    present an input had it maintained consistent input→frame delivery.

    2. Fast scroll continuity: There must be no missed VSyncs between
    consecutive frames containing scroll updates with absolute total raw scroll
    delta greater than or equal to 3 pixels.

    3. Fling continuity: There must be no missed VSyncs during the transition
    from a regular scroll to a fling UNLESS the regular scroll is slow with
    absolute total raw scroll delta less than 3 pixels per frame. There must
    also be no missed VSyncs between consecutive inertial frames EXCEPT towards
    the end of a fling if the absolute total raw scroll delta drops below 0.2
    pixels per frame.

    This metric is different from traditional graphics smoothness metrics as it
    considers performance degradation on all threads and processes including
    Browser and IO, unlike graphics' smoothness metrics which focus on the core
    graphics pipeline (Renderer/GPU).

    This metric is only recorded when 64 frames are presented, for example if a
    scroll only has 12 frames, the next scroll has 40 frames and the scroll
    after has 12 frames, the metric only will be emitted after the 3rd scroll.
    This means the last incomplete window might not get reported as the browser
    terminates. This metric emits zero in the case when no VSyncs were missed in
    a window of 64 frames.

    For more details about this metric, please check
    https://docs.google.com/document/d/1AaBvTIf8i-c-WTKkjaL4vyhQMkSdynxo3XEiwpofdeA

    [1] An inertial scroll (aka a fling) is a finger boosted scroll, meaning the
    screen is moving after the user has accelerated their finger on the screen
    and removed it.
  </summary>
  <token key="Operator" variants="ScrollJankOperator"/>
</histogram>

<histogram name="EventLatency.GestureScrollUpdate.Touchscreen.TotalLatency"
    units="microseconds" expires_after="never">
<!-- expires-never: guiding metric (internal: go/chrome-browser-guiding-metrics) -->

  <owner>jonross@chromium.org</owner>
  <owner>chrome-gpu-metric-alerts@chromium.org</owner>
  <owner>chrome-analysis-team@google.com</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    When a user performs a scroll using touchscreen, a sequence of touch-move
    events are generated leading to a sequence of gesture-scroll-update events.
    This metric measures total latency of those gesture-scroll-update events
    excluding the first one in the sequence and those that are inertial (i.e.
    generated as a result of a user fling). Total latency means the time from
    when the touch-move causing a gesture-scroll-update is generated until when
    the changes caused by the event are successfully presented on the screen.

    This histogram will eventually be replaced by its TotalLatency2 equivalent
    which uses an improved bucketing.

    This histogram only records metrics on machines with high-resolution clocks.
  </summary>
</histogram>

<histogram name="EventLatency.GestureScrollUpdate.Touchscreen.TotalLatency2"
    units="microseconds" expires_after="2026-12-27">
  <owner>jonross@chromium.org</owner>
  <owner>chrome-gpu-metric-alerts@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    When a user performs a scroll using touchscreen, a sequence of touch-move
    events are generated leading to a sequence of gesture-scroll-update events.
    This metric measures total latency of those gesture-scroll-update events
    excluding the first one in the sequence and those that are inertial (i.e.
    generated as a result of a user fling). Total latency means the time from
    when the touch-move causing a gesture-scroll-update is generated until when
    the changes caused by the event are successfully presented on the screen.

    This histogram is similar to its TotalLatency (non-v2) equivalent except
    that it uses an improved bucketing. We will eventually remove the non-v2
    version.

    This histogram only records metrics on machines with high-resolution clocks.
  </summary>
</histogram>

<histogram
    name="EventLatency.GestureScrollUpdate.{NonTouchscreenScrollInputType}.TotalLatency2"
    units="microseconds" expires_after="2027-01-10">
  <owner>jonross@chromium.org</owner>
  <owner>chrome-gpu-metric-alerts@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Tracks total latency of {NonTouchscreenScrollInputType}
    gesture-scroll-update events that are non-inertial (i.e. not generated due
    to a user fling) and not the first one in a scroll sequence, from when the
    user input causing the event is performed until the frame caused by the
    event is submitted by the GPU service and presented successfully on the
    screen.

    This histogram only records metrics on machines with high-resolution clocks.
  </summary>
  <token key="NonTouchscreenScrollInputType">
    <variant name="Autoscroll" summary="autoscroll"/>
    <variant name="Scrollbar" summary="scrollbar"/>
    <variant name="Wheel" summary="mouse wheel or touchpad"/>
  </token>
</histogram>

<histogram name="EventLatency.TotalLatency" units="microseconds"
    expires_after="2027-01-17">
  <owner>jonross@chromium.org</owner>
  <owner>chrome-gpu-metric-alerts@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Tracks total latency of all event types, from when the user input causing
    the event is performed until the frame caused by the event is submitted by
    the GPU service and presented successfully on the screen.

    This histogram only records metrics on machines with high-resolution clocks.
  </summary>
</histogram>

<histogram
    name="EventLatency.{NonGsuScrollEventType}.{ScrollInputType}.TotalLatency2"
    units="microseconds" expires_after="2027-02-07">
  <owner>jonross@chromium.org</owner>
  <owner>chrome-gpu-metric-alerts@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Tracks total latency of {ScrollInputType} {NonGsuScrollEventType}, from when
    the user input causing the event is performed until the frame caused by the
    event is submitted by the GPU service and presented successfully on the
    screen.

    This histogram only records metrics on machines with high-resolution clocks.
  </summary>
  <token key="NonGsuScrollEventType">
    <variant name="FirstGestureScrollUpdate"
        summary="gesture-scroll-update events that are the first one in a
                 scroll sequence"/>
    <variant name="GestureScrollBegin"
        summary="gesture-scroll-begin event. These are rarely handled, as
                 most user initiated scrolls will start with
                 FirstGestureScrollUpdate. Which was added to match the
                 legacy
                 Event.Latency.ScrollUpdate.Touch.TimeToScrollUpdateSwapBegin4.
                 This tracks GestureScrollBegin"/>
    <variant name="GestureScrollEnd" summary="gesture-scroll-end events"/>
    <variant name="InertialGestureScrollEnd"
        summary="gesture-scroll-end events that are inertial (i.e. generated
                 due to a user fling)"/>
    <variant name="InertialGestureScrollUpdate"
        summary="gesture-scroll-update events that are inertial (i.e.
                 generated due to a user fling)"/>
  </token>
</histogram>

<histogram name="EventLatency.{NonScrollPinchEventType}.TotalLatency"
    units="microseconds" expires_after="2027-01-03">
  <owner>jonross@chromium.org</owner>
  <owner>chrome-gpu-metric-alerts@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Tracks total latency of {NonScrollPinchEventType}, from when the user input
    causing the event is performed generated until the frame caused by the event
    is submitted by the GPU service and presented successfully on the screen.

    This histogram only records metrics on machines with high-resolution clocks.
  </summary>
  <token key="NonScrollPinchEventType">
    <variant name="GestureDoubleTap" summary="gesture-double-tap events"/>
    <variant name="GestureLongPress" summary="gesture-long-press events"/>
    <variant name="GestureLongTap" summary="gesture-long-tap events"/>
    <variant name="GestureShowPress" summary="gesture-show-press events"/>
    <variant name="GestureTap" summary="gesture-tap events"/>
    <variant name="GestureTapCancel" summary="gesture-tap-cancel events"/>
    <variant name="GestureTapDown" summary="gesture-tap-down events"/>
    <variant name="GestureTapUnconfirmed"
        summary="gesture-tap-unconfirmed events"/>
    <variant name="GestureTwoFingerTap"
        summary="gesture-two-finger-tap events"/>
    <variant name="KeyPressed" summary="key-pressed events"/>
    <variant name="KeyReleased" summary="key-released events"/>
    <variant name="MouseDragged" summary="mouse-dragged events"/>
    <variant name="MouseMoved" summary="mouse-moved events"/>
    <variant name="MousePressed" summary="mouse-pressed events"/>
    <variant name="MouseReleased" summary="mouse-released events"/>
    <variant name="MouseWheel" summary="mouse-wheel events"/>
    <variant name="TouchMoved" summary="touch-moved events"/>
    <variant name="TouchPressed" summary="touch-pressed events"/>
    <variant name="TouchReleased" summary="touch-released events"/>
  </token>
</histogram>

<histogram name="EventLatency.{PinchEventType}.{PinchInputType}.TotalLatency"
    units="microseconds" expires_after="2027-02-07">
  <owner>jonross@chromium.org</owner>
  <owner>chrome-gpu-metric-alerts@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Tracks total latency of {PinchInputType} {PinchEventType}, from when the
    user input causing the event is performed until the frame caused by the
    event is submitted by the GPU service and presented successfully on the
    screen.

    This histogram only records metrics on machines with high-resolution clocks.
  </summary>
  <token key="PinchEventType">
    <variant name="GesturePinchBegin" summary="gesture-pinch-begin events"/>
    <variant name="GesturePinchEnd" summary="gesture-pinch-end events"/>
    <variant name="GesturePinchUpdate"
        summary="gesture-pinch-update events in a scroll sequence"/>
  </token>
  <token key="PinchInputType">
    <variant name="Touchpad" summary="touchpad"/>
    <variant name="Touchscreen" summary="touchscreen"/>
  </token>
</histogram>

<histogram name="EventLatency.{ScrollEventType}.GenerationToBrowserMain"
    units="microseconds" expires_after="2027-02-07">
  <owner>jonross@chromium.org</owner>
  <owner>chrome-gpu-metric-alerts@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Tracks latency from when the user input causing the event is generated until
    the the event is first processed on the Browser Main Thread. Reported for
    {ScrollEventType}.

    This histogram only records metrics on machines with high-resolution clocks.
  </summary>
  <token key="ScrollEventType" variants="ScrollEventType"/>
</histogram>

<histogram name="EventLatency.{ScrollEventType}.TotalLatency2"
    units="microseconds" expires_after="2027-01-03">
  <owner>jonross@chromium.org</owner>
  <owner>chrome-gpu-metric-alerts@chromium.org</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    Tracks total latency of {ScrollEventType}, from when the user input causing
    the event is performed generated until the frame caused by the event is
    submitted by the GPU service and presented successfully on the screen.

    This histogram only records metrics on machines with high-resolution clocks.
  </summary>
  <token key="ScrollEventType" variants="ScrollEventType"/>
</histogram>

<histogram name="EventLatency.{ScrollEventType}.{TopControls}"
    units="microseconds" expires_after="2027-02-07">
  <owner>jonross@chromium.org</owner>
  <owner>chrome-gpu-metric-alerts@chromium.org</owner>
  <summary>
    Tracks total latency of {ScrollEventType}, from when the user input causing
    the event is performed generated until the frame caused by the event is
    submitted by the GPU service and presented successfully on the screen.

    This is reported for {TopControls}.

    This histogram only records metrics on machines with high-resolution clocks.
  </summary>
  <token key="ScrollEventType" variants="ScrollEventType"/>
  <token key="TopControls">
    <variant name="TopControlsDidNotMove"
        summary="when Android Top Controls did not move during the scroll.
                 This is subsampled at a rate of 1:1000 as there is
                 significantly higher volume of these scrolls."/>
    <variant name="TopControlsMoved"
        summary="when the Android Top Controls moved during the scroll.
                 Reported for all such scrolls."/>
  </token>
</histogram>

</histograms>

</histogram-configuration>
