# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

# Adding a new metric? We have docs for that!
# https://firefox-source-docs.mozilla.org/toolkit/components/glean/user/new_definitions_file.html

---
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
$tags:
  - 'Core :: Graphics'

paint:
  build_displaylist_time:
    type: timing_distribution
    description: >
      The time to build a Gecko display list.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1728423
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1728423
    data_sensitivity:
      - technical
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - mwoodrow@mozilla.com
    expires: never

gpu_process:
  feature_status:
    type: string
    description: >
      Current status of the GPU process feature
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1870021
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1870021
    data_sensitivity:
      - technical
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - jnicol@mozilla.com
    expires: never
  crash_fallbacks:
    type: labeled_counter
    description: >
      How often we use different fallbacks when the GPU process crashes
    labels:
      - none
      - decoding_disabled
      - disabled
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1870021
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1870021
    data_sensitivity:
      - technical
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - jnicol@mozilla.com
    expires: never
  total_launch_attempts:
    type: quantity
    description: >
      The number of total GPU process launch attempts.
    unit: launches
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1870021
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1870021
    data_sensitivity:
      - technical
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - jnicol@mozilla.com
    expires: never
  unstable_launch_attempts:
    type: quantity
    description: >
      The number of consecutive unstable launch attempts.
    unit: launches
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1870021
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1870021
    data_sensitivity:
      - technical
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - jnicol@mozilla.com
    expires: never

  launch_time:
    type: timing_distribution
    description: >
      GPU process launch time in milliseconds

      This metric was generated to correspond to the Legacy Telemetry
      exponential histogram GPU_PROCESS_LAUNCH_TIME_MS_2.
    time_unit: millisecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1297790
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1317796
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1489524
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1297790
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1317796
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1489524
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - rhunt@mozilla.com
      - dbolter@mozilla.com
    expires: never
    telemetry_mirror: GPU_PROCESS_LAUNCH_TIME_MS_2

  initialization_time:
    type: timing_distribution
    description: >
      GPU process initialization (excluding XPCOM and fork time) time in
      milliseconds

      This metric was generated to correspond to the Legacy Telemetry
      exponential histogram GPU_PROCESS_INITIALIZATION_TIME_MS.
    time_unit: millisecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1324095
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1489524
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1324095
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1489524
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - rhunt@mozilla.com
      - dbolter@mozilla.com
    expires: never
    telemetry_mirror: GPU_PROCESS_INITIALIZATION_TIME_MS

wr:
  gpu_wait_time:
    type: timing_distribution
    description: >
      The time spent waiting for the GPU to complete previously issued drawing
      commands.
    time_unit: microsecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1772216
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1772216
    data_sensitivity:
      - technical
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  rasterize_glyphs_time:
    type: timing_distribution
    description: >
      The time to rasterize glyphs for consumption by WebRender.
    time_unit: microsecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1728423
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1728423
    data_sensitivity:
      - technical
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  rasterize_blobs_time:
    type: timing_distribution
    description: >
      The time to rasterize blobs for consumption by WebRender.
    time_unit: microsecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1770974
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1770974
    data_sensitivity:
      - technical
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  renderer_time:
    type: timing_distribution
    description: >
      WebRender renderer time.
    time_unit: microsecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1772223
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1772223
    data_sensitivity:
      - technical
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  renderer_time_no_sc:
    type: timing_distribution
    description: >
      WebRender renderer time excluding frames in which shader compilation took
      place.
    time_unit: microsecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1784286
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1784286
    data_sensitivity:
      - technical
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  framebuild_time:
    type: timing_distribution
    description: >
      The time to rasterize glyphs for consumption by WebRender.
    time_unit: microsecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1470901
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1470901
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
    data_sensitivity:
      - technical
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - jmuizelaar@mozilla.com
    expires: never

  scenebuild_time:
    type: timing_distribution
    description: >
      WebRender scene build time.
    time_unit: microsecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1470901
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1470901
    data_sensitivity:
      - technical
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - jmuizelaar@mozilla.com
    expires: never

  shaderload_time:
    type: timing_distribution
    description: >
      Time spent blocking on the shader compilation for LazilyCompiled shaders
      created with ASYNC_COMPILE or FULL_COMPILE.
    time_unit: microsecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1954566
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1954566
    data_sensitivity:
      - technical
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - jmuizelaar@mozilla.com
    expires: never

  sceneswap_time:
    type: timing_distribution
    description: >
      WebRender scene swap time.
    time_unit: microsecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1470901
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1470901
    data_sensitivity:
      - technical
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - jmuizelaar@mozilla.com
    expires: never

  texture_cache_update_time:
    type: timing_distribution
    description: >
      Time taken by WebRender to update the texture cache.
    time_unit: microsecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1772223
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1772223
    data_sensitivity:
      - technical
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  time_to_frame_build:
    type: timing_distribution
    description: >
      Time elapsed between the construction of a transaction and the
      associated frame build beginning.
    time_unit: microsecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1778395
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1778395
    data_sensitivity:
      - technical
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  time_to_render_start:
    type: timing_distribution
    description: >
      Time elapsed between the construction of a frame and the start of
      rendering.
    time_unit: microsecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1778395
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1778395
    data_sensitivity:
      - technical
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

gfx:
  composite_time:
    type: timing_distribution
    time_unit: millisecond
    description: >
      The time taken to composite a frame.
      On non-webrender this is the time taken in
      `CompositorBridgeParent::CompositeToTarget()`.
      On webrender, this is the time taken from the start of
      `WebRenderBridgeParent::CompositeToTarget()`,
      until the render thread has rendered the frame (in
      `RenderThread::HandleFrameOneDoc()`).
      (Migrated from the geckoview metric of the same name).
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1080160
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1529352
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1580129
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1580129#c7
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - jnicol@mozilla.com
      - perf-telemetry-alerts@mozilla.com
    expires: never
    metadata:
      monitor:
        alert: False
        lower_is_better: True
        platforms:
          - All


  scroll_present_latency:
    type: timing_distribution
    time_unit: millisecond
    description: >
      Time between receiving a scroll
      event on the event loop and compositing
      its result onto the screen (ms).
      (Migrated from the geckoview metric of the same name).
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1604818
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1604818#c4
    notification_emails:
      - sefeng@mozilla.com
      - perf-telemetry-alerts@mozilla.com
    expires: never
    metadata:
      monitor:
        alert: False
        lower_is_better: True
        platforms:
          - All

  skipped_composites:
    type: counter
    description: >
      Number of skipped composites, happening when rendering is too slow
      to keep up with content.
      This metric was generated to correspond to the Legacy Telemetry
      scalar gfx.skipped_composites.
    bugs:
      - https://bugzil.la/1797975
    data_reviews:
      - https://bugzil.la/1797975
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - perf-telemetry-alerts@mozilla.com
    expires: never

  os_compositor:
    type: boolean
    description: >
      Boolean indicating whether the os compositor is being used by
      WebRender. Only collected in the first subsession.
      This metric was generated to correspond to the Legacy Telemetry
      scalar gfx.os_compositor.
    bugs:
      - https://bugzil.la/1623492
    data_reviews:
      - https://bugzil.la/1623492
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - jmuizelaar@mozilla.com
    expires: never
    telemetry_mirror: GFX_OS_COMPOSITOR

  linux_window_protocol:
    type: string
    description: >
      Windowing protocol on Linux. Can be Wayland, WaylandDRM, XWayland,
      or X11
      This metric was generated to correspond to the Legacy Telemetry
      scalar gfx.linux_window_protocol.
    bugs:
      - https://bugzil.la/1645732
    data_reviews:
      - https://bugzil.la/1645732
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - aosmond@mozilla.com
      - mkaply@mozilla.com
    expires: never
    telemetry_mirror: GFX_LINUX_WINDOW_PROTOCOL

  supports_hdr:
    type: boolean
    description: >
      Does the hardware support accurate display of HDR content
      This metric was generated to correspond to the Legacy Telemetry
      scalar gfx.supports_hdr.
    bugs:
      - https://bugzil.la/1798067
    data_reviews:
      - https://bugzil.la/1798067
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - bwerth@mozilla.com
    expires: never
    telemetry_mirror: GFX_SUPPORTS_HDR

  composite_swap_time:
    type: custom_distribution
    description: >
      Time to do swap/present/commit in 100 microseconds

      This metric was generated to correspond to the Legacy Telemetry
      exponential histogram COMPOSITE_SWAP_TIME.
    range_min: 1
    range_max: 1000
    bucket_count: 50
    histogram_type: exponential
    unit: 100 microseconds
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1612511
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1612511
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - jmuizelaar@mozilla.com
    expires: never

  composite_frame_roundtrip_time:
    type: timing_distribution
    description: >
      Time from vsync to finishing a composite in milliseconds.

      This metric was generated to correspond to the Legacy Telemetry
      exponential histogram COMPOSITE_FRAME_ROUNDTRIP_TIME.
    time_unit: millisecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - rhunt@mozilla.com
    expires: never

  device_reset_reason:
    type: custom_distribution
    description: >
      GPU Device Reset Reason (ok, hung, removed, reset, internal error, invalid
      call, out of memory)

      This metric was generated to correspond to the Legacy Telemetry enumerated
      histogram DEVICE_RESET_REASON.
    range_min: 0
    range_max: 10
    bucket_count: 11
    histogram_type: linear
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1135408
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1529352
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1135408
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1529352
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - rhunt@mozilla.com
    expires: never
    telemetry_mirror: DEVICE_RESET_REASON

  forced_device_reset_reason:
    type: custom_distribution
    description: >
      GPU Forced Device Reset Reason (OpenSharedHandle)

      This metric was generated to correspond to the Legacy Telemetry enumerated
      histogram FORCED_DEVICE_RESET_REASON.
    range_min: 0
    range_max: 50
    bucket_count: 51
    histogram_type: linear
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1235407
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1235407
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - rhunt@mozilla.com
    expires: never
    telemetry_mirror: FORCED_DEVICE_RESET_REASON

  graphics_driver_startup_test:
    type: custom_distribution
    description: >
      Reports whether or not graphics drivers crashed during startup.

      This metric was generated to correspond to the Legacy Telemetry enumerated
      histogram GRAPHICS_DRIVER_STARTUP_TEST.
    range_min: 0
    range_max: 20
    bucket_count: 21
    histogram_type: linear
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - rhunt@mozilla.com
    expires: never
    telemetry_mirror: GRAPHICS_DRIVER_STARTUP_TEST

  content_failed_to_acquire_device:
    type: custom_distribution
    description: >
      Failed to create a gfx content device. 0=content d3d11, 1=image d3d11,
      2=d2d1.

      This metric was generated to correspond to the Legacy Telemetry enumerated
      histogram GFX_CONTENT_FAILED_TO_ACQUIRE_DEVICE.
    range_min: 0
    range_max: 6
    bucket_count: 7
    histogram_type: linear
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - rhunt@mozilla.com
    expires: never
    telemetry_mirror: GFX_CONTENT_FAILED_TO_ACQUIRE_DEVICE

  crash:
    type: custom_distribution
    description: >
      Graphics Crash Reason (...)

      This metric was generated to correspond to the Legacy Telemetry enumerated
      histogram GFX_CRASH.
    range_min: 0
    range_max: 100
    bucket_count: 101
    histogram_type: linear
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - rhunt@mozilla.com
    expires: never
    telemetry_mirror: GFX_CRASH

  macos_video_low_power:
    type: labeled_counter
    description: >
      MacOS video low power state achieved when enqueueing a video frame.

      This metric was generated to correspond to the Legacy Telemetry
      categorical histogram GFX_MACOS_VIDEO_LOW_POWER.
    labels:
      - NotVideo
      - LowPower
      - FailMultipleVideo
      - FailWindowed
      - FailOverlaid
      - FailBacking
      - FailMacOSVersion
      - FailPref
      - FailSurface
      - FailEnqueue
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1737682
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1737682
    notification_emails:
      - bwerth@mozilla.com
    expires: never
    telemetry_mirror: h#GFX_MACOS_VIDEO_LOW_POWER

  sanity_test:
    type: custom_distribution
    description: >
      Reports results from the graphics sanity test to track which drivers are
      having problems (0=TEST_PASSED, 1=TEST_FAILED_RENDER, 2=TEST_FAILED_VIDEO,
      3=TEST_CRASHED)

      This metric was generated to correspond to the Legacy Telemetry enumerated
      histogram GRAPHICS_SANITY_TEST.
    range_min: 0
    range_max: 20
    bucket_count: 21
    histogram_type: linear
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - rhunt@mozilla.com
    expires: never
    telemetry_mirror: GRAPHICS_SANITY_TEST

gfx.display:
  count:
    description: >
      Amount of displays connected to the device
      (Migrated from the geckoview metric of the same name).
    type: quantity
    unit: Display count
    # Temporary misuse of the user lifetime approved by Glean team
    # due to limitations in Geckoview streaming telemetry.
    # DO NOT DUPLICATE unless approved by Glean team.
    lifetime: user
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1687219
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  primary_width:
    description: >
      Width of the primary display, takes device rotation into account.
      (Migrated from the geckoview metric of the same name).
    type: quantity
    unit: Pixels
    # Temporary misuse of the user lifetime approved by Glean team
    # due to limitations in Geckoview streaming telemetry.
    # DO NOT DUPLICATE unless approved by Glean team.
    lifetime: user
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1687219
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  primary_height:
    description: >
      Height of the primary display, takes device rotation into account.
      (Migrated from the geckoview metric of the same name).
    type: quantity
    unit: Pixels
    # Temporary misuse of the user lifetime approved by Glean team
    # due to limitations in Geckoview streaming telemetry.
    # DO NOT DUPLICATE unless approved by Glean team.
    lifetime: user
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1687219
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  scaling:
    type: custom_distribution
    description: >
      Scaling percentage for the display where the first window is opened

      This metric was generated to correspond to the Legacy Telemetry linear
      histogram DISPLAY_SCALING.
    range_min: 1
    range_max: 500
    bucket_count: 100
    histogram_type: linear
    unit: percentage
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1121966
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1121966
    notification_emails:
      - perf-telemetry-alerts@mozilla.com
    expires: never

gfx.checkerboard:
  duration:
    type: timing_distribution
    time_unit: millisecond
    description: >
      The duration of a checkerboard event.
      Checkerboarding is when painting has not kept up with asynchronous
      panning and zooming so the compositor has to display a "checkerboard
      pattern" (or in practice, the background color) rather than the actual
      page content.
      (Migrated from the geckoview metric of the same name).
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1238040
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1539309
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - botond@mozilla.com
    expires: never

  peak_pixel_count:
    type: custom_distribution
    range_max: 66355200
    bucket_count: 50
    histogram_type: exponential
    unit: Pixels
    description: >
      The peak number of CSS pixels that checkerboarded during a checkerboard
      event. The minimum value of the largest histogram bucket is the size of
      a 4k display with maximum APZ zooming.
      (Migrated from the geckoview metric of the same name).
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1238040
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1539309
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - botond@mozilla.com
    expires: never

  potential_duration:
    type: timing_distribution
    time_unit: millisecond
    description: >
      The total amount of time that we could reasonably be checkerboarding.
      This is the union of two possibly-intersecting sets of time periods:
      The first set is that in which checkerboarding was actually happening,
      since by definition it could potentially be happening.
      The second set is that in which the APZC is actively transforming content
      in the compositor, since it could potentially transform it so as to
      display checkerboarding to the user. Combined with other information,
      this allows us to meaningfully say how frequently users actually
      enncounters checkerboarding.
      (Migrated from the geckoview metric of the same name).
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1238040
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1539309
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - botond@mozilla.com
    expires: never

  severity:
    type: custom_distribution
    range_max: 1073741824
    bucket_count: 50
    histogram_type: exponential
    unit: Opaque unit
    description: >
      An opaque measurement of the severity of a checkerboard event.
      This doesn't have units, it's just useful for comparing two checkerboard
      events to see which one is worse, for some implementation-specific
      definition of "worse". The larger the value, the worse the
      checkerboarding.
      (Migrated from the geckoview metric of the same name).
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1238040
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1539309
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - botond@mozilla.com
    expires: never

gfx.feature:
  webrender:
    type: string
    description: >
      Whether webrender is enabled or disabled, and why.
      (Migrated from the geckoview metric of the same name).
    lifetime: application
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1687312
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1687312#c5
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - jnicol@mozilla.com
    expires: never

gfx.status:
  compositor:
    description: >
      Name of the graphics compositor in use.
      Possible values are "opengl, d3d11, client, webrender or basic"
      (Migrated from the geckoview metric of the same name).
    type: string
    # Temporary misuse of the user lifetime approved by Glean team
    # due to limitations in Geckoview streaming telemetry.
    # DO NOT DUPLICATE unless approved by Glean team.
    lifetime: user
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1687219
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never
  last_compositor_gecko_version:
    description: >
      The gecko version at the last time a compositor was initialized, and
      therefore when gfx_status_compositor was last updated. Due to
      gfx_status_compositor's user lifetime we see lots of unexpected values for
      the current gecko version. We believe this is because the user has not
      opened a tab since they were updated to a version where webrender should
      be enabled on their device. This can be used to verify that theory.
      (Migrated from the geckoview metric of the same name).
    type: string
    # Temporary misuse of the user lifetime approved by Glean team
    # due to limitations in Geckoview streaming telemetry.
    # DO NOT DUPLICATE unless approved by Glean team.
    lifetime: user
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1704842
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1704842#c8
    notification_emails:
      - jnicol@mozilla.com
      - gfx-telemetry-alerts@mozilla.com
    expires: never
  headless:
    description: >
      Boolean indicated whether graphics is running in
      headless (no display) mode
      (Migrated from the geckoview metric of the same name).
    type: boolean
    # Temporary misuse of the user lifetime approved by Glean team
    # due to limitations in Geckoview streaming telemetry.
    # DO NOT DUPLICATE unless approved by Glean team.
    lifetime: user
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1687219
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

gfx.content.frame_time:
  from_paint:
    type: custom_distribution
    range_max: 5000
    bucket_count: 50
    histogram_type: exponential
    unit: Percentage of vsync interval
    description: >
      The time, in percentage of a vsync interval, spent from beginning a paint
      in the content process until that frame is presented in the compositor.
      (Migrated from the geckoview metric of the same name).
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1470528
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1509536
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - jnicol@mozilla.com
    expires: never

  from_vsync:
    type: custom_distribution
    range_min: 8
    range_max: 792
    bucket_count: 100
    histogram_type: linear
    unit: Percentage of vsync interval
    description: >
      The time, in percentage of a vsync interval, spent from the vsync that
      started a paint in the content process until that frame is presented in
      the compositor.
      (Migrated from the geckoview metric of the same name).
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1517355
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  with_svg:
    type: custom_distribution
    range_max: 5000
    bucket_count: 50
    histogram_type: exponential
    unit: Percentage of vsync interval
    description: >
      The time, in percentage of a vsync interval, spent from beginning a paint
      in the content process until that frame is presented in the compositor,
      for frames that contained an SVG to be drawn by webrender.
      (Migrated from the geckoview metric of the same name).
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1483549
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1509536
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  without_resource_upload:
    type: custom_distribution
    range_max: 5000
    bucket_count: 50
    histogram_type: exponential
    unit: Percentage of vsync interval
    description: >
      The time, in percentage of a vsync interval, spent from beginning a paint
      in the content process until that frame is presented in the compositor by
      webrender, excluding time spent uploading resources.
      (Migrated from the geckoview metric of the same name).
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1503405
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  without_upload:
    type: custom_distribution
    range_max: 5000
    bucket_count: 50
    histogram_type: exponential
    unit: Percentage of vsync interval
    description: >
      The time, in percentage of a vsync interval, spent from beginning a paint
      in the content process until that frame is presented in the compositor by
      webrender, excluding time spent uploading any content.
      (Migrated from the geckoview metric of the same name).
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1503405
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  reason:
    type: labeled_counter
    labels:
      - on_time
      - no_vsync
      - missed_composite
      - slow_composite
      - missed_composite_mid
      - missed_composite_long
      - missed_composite_low
      - no_vsync_no_id
    description: >
      The reason that `gfx.content.frame_time.from_paint` recorded a slow
      (>200ms) result, if any.
      (Migrated from the geckoview metric of the same name).
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1510853
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

gfx.content:
  paint_time:
    type: timing_distribution
    time_unit: millisecond
    description: >
      Time spent in the main-thread paint pipeline for content.
      For non-webrender, this includes display list building, layer building,
      and when OMTP is disabled, rasterization.
      For webrender, this includes display list building, and webrender display
      list building.
      (Migrated from the geckoview metric of the same name).
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1309442
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1489524
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  full_paint_time:
    type: timing_distribution
    time_unit: millisecond
    description: >
      Time spent in the full paint pipeline for content until it's ready for
      composition.
      For non-webrender this includes `paint_time`, plus rasterization if OMTP
      is enabled.
      For webrender, this includes `paint_time`, plus scene building time.
      (Migrated from the geckoview metric of the same name).
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1505858
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - jmuizelaar@mozilla.com
    expires: never
    metadata:
      monitor:
        alert: False
        lower_is_better: True
        platforms:
          - All

  small_paint_phase_weight_partial:
    type: labeled_custom_distribution
    description: >
      Percentages of times for phases in a normal content paint relative to the
      time spent in the entire normal paint. ("dl" = Display list, "wrdl" =
      WebRender display list, "sb" = Scene building, "fb" = Frame building)

      This metric was generated to correspond to the Legacy Telemetry linear
      histogram CONTENT_SMALL_PAINT_PHASE_WEIGHT_PARTIAL.
    range_min: 1
    range_max: 100
    bucket_count: 12
    histogram_type: linear
    unit: percent
    labels:
      - dl
      - wrdl
      - sb
      - fb
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1430897
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1518134
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1430897
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1518134
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - mmynttinen@mozilla.com
    expires: never

  large_paint_phase_weight_partial:
    type: labeled_custom_distribution
    description: >
      Percentages of times for phases in an expensive content paint relative to
      the time spent in the entire expensive paint. ("dl" = Display list, "wrdl"
      = WebRender display list, "sb" = Scene building, "fb" = Frame building)

      This metric was generated to correspond to the Legacy Telemetry linear
      histogram CONTENT_LARGE_PAINT_PHASE_WEIGHT_PARTIAL.
    range_min: 1
    range_max: 100
    bucket_count: 12
    histogram_type: linear
    unit: percent
    labels:
      - dl
      - wrdl
      - sb
      - fb
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1309442
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1518134
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1309442
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1518134
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - mmynttinen@mozilla.com
    expires: never

  small_paint_phase_weight_full:
    type: labeled_custom_distribution
    description: >
      Percentages of times for phases in a normal content paint relative to the
      time spent in the entire normal paint. ("dl" = Display list, "wrdl" =
      WebRender display list, "sb" = Scene building, "fb" = Frame building)

      This metric was generated to correspond to the Legacy Telemetry linear
      histogram CONTENT_SMALL_PAINT_PHASE_WEIGHT_FULL.
    range_min: 1
    range_max: 100
    bucket_count: 12
    histogram_type: linear
    unit: percent
    labels:
      - dl
      - wrdl
      - sb
      - fb
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1430897
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1518134
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1430897
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1518134
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - mmynttinen@mozilla.com
    expires: never

  large_paint_phase_weight_full:
    type: labeled_custom_distribution
    description: >
      Percentages of times for phases in an expensive content paint relative to
      the time spent in the entire expensive paint. ("dl" = Display list, "wrdl"
      = WebRender display list, "sb" = Scene building, "fb" = Frame building)

      This metric was generated to correspond to the Legacy Telemetry linear
      histogram CONTENT_LARGE_PAINT_PHASE_WEIGHT_FULL.
    range_min: 1
    range_max: 100
    bucket_count: 12
    histogram_type: linear
    unit: percent
    labels:
      - dl
      - wrdl
      - sb
      - fb
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1309442
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1518134
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1309442
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1518134
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - mmynttinen@mozilla.com
    expires: never

gfx.adapter.primary:
  description:
    description: >
      Long form description of the Graphics adapter
      (Migrated from the geckoview metric of the same name).
    type: string
    # Temporary misuse of the user lifetime approved by Glean team
    # due to limitations in Geckoview streaming telemetry.
    # DO NOT DUPLICATE unless approved by Glean team.
    lifetime: user
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1687219
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  vendor_id:
    description: >
      Graphics adapter vendor identification
      (Migrated from the geckoview metric of the same name).
    type: string
    # Temporary misuse of the user lifetime approved by Glean team
    # due to limitations in Geckoview streaming telemetry.
    # DO NOT DUPLICATE unless approved by Glean team.
    lifetime: user
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1687219
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  device_id:
    description: >
      Graphics adapter device identification
      (Migrated from the geckoview metric of the same name).
    type: string
    # Temporary misuse of the user lifetime approved by Glean team
    # due to limitations in Geckoview streaming telemetry.
    # DO NOT DUPLICATE unless approved by Glean team.
    lifetime: user
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1687219
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  subsystem_id:
    description: >
      Graphics adapter subsystem identification
      (Migrated from the geckoview metric of the same name).
    type: string
    # Temporary misuse of the user lifetime approved by Glean team
    # due to limitations in Geckoview streaming telemetry.
    # DO NOT DUPLICATE unless approved by Glean team.
    lifetime: user
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1687219
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  ram:
    description: >
      Graphics adapter dedicated memory
      (Migrated from the geckoview metric of the same name).
    type: quantity
    unit: Megabytes
    # Temporary misuse of the user lifetime approved by Glean team
    # due to limitations in Geckoview streaming telemetry.
    # DO NOT DUPLICATE unless approved by Glean team.
    lifetime: user
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1687219
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  driver_files:
    description: >
      List of graphics adapter driver files
      (Migrated from the geckoview metric of the same name).
    type: string
    # Temporary misuse of the user lifetime approved by Glean team
    # due to limitations in Geckoview streaming telemetry.
    # DO NOT DUPLICATE unless approved by Glean team.
    lifetime: user
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1687219
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  driver_vendor:
    description: >
      Graphics adapter driver vendor identification
      (Migrated from the geckoview metric of the same name).
    type: string
    # Temporary misuse of the user lifetime approved by Glean team
    # due to limitations in Geckoview streaming telemetry.
    # DO NOT DUPLICATE unless approved by Glean team.
    lifetime: user
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1687219
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  driver_version:
    description: >
      Graphics adapter driver version
      (Migrated from the geckoview metric of the same name).
    type: string
    # Temporary misuse of the user lifetime approved by Glean team
    # due to limitations in Geckoview streaming telemetry.
    # DO NOT DUPLICATE unless approved by Glean team.
    lifetime: user
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1687219
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never

  driver_date:
    description: >
      Graphics adapter driver date
      (Migrated from the geckoview metric of the same name).
    type: string
    # Temporary misuse of the user lifetime approved by Glean team
    # due to limitations in Geckoview streaming telemetry.
    # DO NOT DUPLICATE unless approved by Glean team.
    lifetime: user
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1687219
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never


performance.interaction:
  keypress_present_latency:
    type: timing_distribution
    time_unit: millisecond
    description: >
      Time between receiving a keypress event in the event loop and compositing
      its result onto the screen.
      (Migrated from the geckoview metric of the same name).
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1506537
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
    notification_emails:
      - perf-telemetry-alerts@mozilla.com
    expires: never
    metadata:
      monitor:
        alert: False
        lower_is_better: True
        platforms:
          - All

  mouseup_click_present_latency:
    type: timing_distribution
    time_unit: millisecond
    description: >
      Time between receiving a mouseup which follow by a mouseclick
      on the event loop and compositing its result onto the screen.
      (Migrated from the geckoview metric of the same name).
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1698643
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1875170
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1698643#c3
    notification_emails:
      - perf-telemetry-alerts@mozilla.com
      - sefeng@mozilla.com
    expires: never
    metadata:
      monitor:
        alert: False
        lower_is_better: True
        platforms:
          - All

gfx.hdr:
  windows_display_colorspace_bitfield:
    type: quantity
    description: >
      A bitfield representation of the available DXGI color spaces of the
      connected displays on Windows. See (https://docs.microsoft.com/en-
      us/windows/desktop/api/dxgicommon/ne-dxgicommon-
      dxgi_color_space_type) for definitions of color spaces. Each N'th
      bit of this scalar indicates whether the DXGI color space with index
      'N' is available on at least one connected monitor.
      This metric was generated to correspond to the Legacy Telemetry
      scalar gfx.hdr.windows_display_colorspace_bitfield.
    bugs:
      - https://bugzil.la/1514840
      - https://bugzil.la/1690597
    data_reviews:
      - https://bugzil.la/1514840
      - https://bugzil.la/1690597
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - jmuizelaaar@mozilla.com
    expires: never
    unit: bitfield
    telemetry_mirror: GFX_HDR_WINDOWS_DISPLAY_COLORSPACE_BITFIELD

fontlist:
  initotherfamilynames:
    type: timing_distribution
    description: >
      Time(ms) spent on reading other family names from all fonts

      This metric was generated to correspond to the Legacy Telemetry
      exponential histogram FONTLIST_INITOTHERFAMILYNAMES.
    time_unit: millisecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never
    telemetry_mirror: FONTLIST_INITOTHERFAMILYNAMES

  initotherfamilynames_no_deferring:
    type: timing_distribution
    description: >
      Time(ms) spent on reading other family names from all fonts for no timeout
      case

      This metric was generated to correspond to the Legacy Telemetry
      exponential histogram FONTLIST_INITOTHERFAMILYNAMES_NO_DEFERRING.
    time_unit: millisecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never
    telemetry_mirror: FONTLIST_INITOTHERFAMILYNAMES_NO_DEFERRING

  initfacenamelists:
    type: timing_distribution
    description: >
      Time(ms) spent on reading family names from all fonts

      This metric was generated to correspond to the Legacy Telemetry
      exponential histogram FONTLIST_INITFACENAMELISTS.
    time_unit: millisecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never
    telemetry_mirror: FONTLIST_INITFACENAMELISTS

  bundledfonts_activate:
    type: timing_distribution
    description: >
      Time(ms) spent activating additional fonts bundled with the product

      This metric was generated to correspond to the Legacy Telemetry
      exponential histogram FONTLIST_BUNDLEDFONTS_ACTIVATE.
    time_unit: millisecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1696162
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1696162
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never
    telemetry_mirror: FONTLIST_BUNDLEDFONTS_ACTIVATE

  dwritefont_delayedinit_total:
    type: timing_distribution
    description: >
      gfxDWriteFontList::DelayedInitFontList Total (ms)

      This metric was generated to correspond to the Legacy Telemetry
      exponential histogram DWRITEFONT_DELAYEDINITFONTLIST_TOTAL.
    time_unit: millisecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never
    telemetry_mirror: DWRITEFONT_DELAYEDINITFONTLIST_TOTAL

  dwritefont_delayedinit_count:
    type: custom_distribution
    description: >
      gfxDWriteFontList::DelayedInitFontList Font Family Count

      This metric was generated to correspond to the Legacy Telemetry
      exponential histogram DWRITEFONT_DELAYEDINITFONTLIST_COUNT.
    range_min: 1
    range_max: 10000
    bucket_count: 10
    histogram_type: exponential
    unit: font family count
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never
    telemetry_mirror: DWRITEFONT_DELAYEDINITFONTLIST_COUNT

  dwritefont_delayedinit_collect:
    type: timing_distribution
    description: >
      gfxDWriteFontList::DelayedInitFontList GetSystemFontCollection (ms)

      This metric was generated to correspond to the Legacy Telemetry
      exponential histogram DWRITEFONT_DELAYEDINITFONTLIST_COLLECT.
    time_unit: millisecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never
    telemetry_mirror: DWRITEFONT_DELAYEDINITFONTLIST_COLLECT

  dwritefont_init_problem:
    type: custom_distribution
    description: >
      DirectWrite system fontlist initialization problem (1=GDI interop,
      2=system font collection, 3=no fonts)

      This metric was generated to correspond to the Legacy Telemetry enumerated
      histogram DWRITEFONT_INIT_PROBLEM.
    range_min: 0
    range_max: 8
    bucket_count: 9
    histogram_type: linear
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never
    telemetry_mirror: DWRITEFONT_INIT_PROBLEM

  system_font_fallback:
    type: timing_distribution
    description: >
      System font fallback (us)

      This metric was generated to correspond to the Legacy Telemetry
      exponential histogram SYSTEM_FONT_FALLBACK.
    time_unit: microsecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never
    telemetry_mirror: SYSTEM_FONT_FALLBACK

  system_font_fallback_first:
    type: timing_distribution
    description: >
      System font fallback, first call (ms)

      This metric was generated to correspond to the Legacy Telemetry
      exponential histogram SYSTEM_FONT_FALLBACK_FIRST.
    time_unit: millisecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never
    telemetry_mirror: SYSTEM_FONT_FALLBACK_FIRST

  font_cache_hit:
    type: labeled_counter
    description: >
      font cache hit

      This metric was generated to correspond to the Legacy Telemetry boolean
      histogram FONT_CACHE_HIT.
    labels:
      - "false"
      - "true"
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never
    telemetry_mirror: h#FONT_CACHE_HIT

  bad_fallback_font:
    type: labeled_counter
    description: >
      system fallback font can't be used

      This metric was generated to correspond to the Legacy Telemetry boolean
      histogram BAD_FALLBACK_FONT.
    labels:
      - "false"
      - "true"
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never
    telemetry_mirror: h#BAD_FALLBACK_FONT

  mac_init_total:
    type: timing_distribution
    description: >
      gfxMacPlatformFontList::InitFontList Total (ms)

      This metric was generated to correspond to the Legacy Telemetry
      exponential histogram MAC_INITFONTLIST_TOTAL.
    time_unit: millisecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never
    telemetry_mirror: MAC_INITFONTLIST_TOTAL

apz_zoom:
  activity:
    type: labeled_counter
    description: >
      Whether non-RDM page had user-triggered zooming activity

      This metric was generated to correspond to the Legacy Telemetry boolean
      histogram APZ_ZOOM_ACTIVITY.
    labels:
      - "false"
      - "true"
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1627708
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1672576
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1627708
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1672576
    notification_emails:
      - botond@mozilla.com
    expires: never
    telemetry_mirror: h#APZ_ZOOM_ACTIVITY

  pinchsource:
    type: custom_distribution
    description: >
      Input device that triggered the zoom gesture
      (InputData::PinchGestureSource)

      This metric was generated to correspond to the Legacy Telemetry enumerated
      histogram APZ_ZOOM_PINCHSOURCE.
    range_min: 0
    range_max: 5
    bucket_count: 6
    histogram_type: linear
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1627708
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1672576
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1627708
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1672576
    notification_emails:
      - botond@mozilla.com
    expires: never
    telemetry_mirror: APZ_ZOOM_PINCHSOURCE

webfont:
  download_time:
    type: timing_distribution
    description: >
      Time to download a webfont (ms)

      This metric was generated to correspond to the Legacy Telemetry
      exponential histogram WEBFONT_DOWNLOAD_TIME.
    time_unit: millisecond
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    notification_emails:
      - jkew@mozilla.com
    expires: never
    telemetry_mirror: WEBFONT_DOWNLOAD_TIME

  fonttype:
    type: custom_distribution
    description: >
      Font format type (woff/woff2/ttf/...)

      This metric was generated to correspond to the Legacy Telemetry enumerated
      histogram WEBFONT_FONTTYPE.
    range_min: 0
    range_max: 10
    bucket_count: 11
    histogram_type: linear
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    notification_emails:
      - jkew@mozilla.com
    expires: never
    telemetry_mirror: WEBFONT_FONTTYPE

  srctype:
    type: custom_distribution
    description: >
      Font src type loaded (1 = local, 2 = url, 3 = data)

      This metric was generated to correspond to the Legacy Telemetry enumerated
      histogram WEBFONT_SRCTYPE.
    range_min: 0
    range_max: 5
    bucket_count: 6
    histogram_type: linear
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    notification_emails:
      - jkew@mozilla.com
    expires: never
    telemetry_mirror: WEBFONT_SRCTYPE

  per_page:
    type: counter
    description: >
      Number of fonts loaded at page load

      This metric was generated to correspond to the Legacy Telemetry count
      histogram WEBFONT_PER_PAGE.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    notification_emails:
      - jkew@mozilla.com
    expires: never
    telemetry_mirror: h#WEBFONT_PER_PAGE

  size_per_page:
    type: memory_distribution
    description: >
      Size of all fonts loaded at page load (kb)

      This metric was generated to correspond to the Legacy Telemetry
      exponential histogram WEBFONT_SIZE_PER_PAGE.
    memory_unit: kilobyte
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    notification_emails:
      - jkew@mozilla.com
    expires: never
    telemetry_mirror: WEBFONT_SIZE_PER_PAGE

  size:
    type: memory_distribution
    description: >
      Size of font loaded (kb)

      This metric was generated to correspond to the Legacy Telemetry
      exponential histogram WEBFONT_SIZE.
    memory_unit: kilobyte
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    notification_emails:
      - jkew@mozilla.com
    expires: never
    telemetry_mirror: WEBFONT_SIZE

  compression_woff:
    type: custom_distribution
    description: >
      Compression ratio of WOFF data (%)

      This metric was generated to correspond to the Legacy Telemetry enumerated
      histogram WEBFONT_COMPRESSION_WOFF.
    range_min: 0
    range_max: 50
    bucket_count: 51
    histogram_type: linear
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    notification_emails:
      - jkew@mozilla.com
    expires: never
    telemetry_mirror: WEBFONT_COMPRESSION_WOFF

  compression_woff2:
    type: custom_distribution
    description: >
      Compression ratio of WOFF2 data (%)

      This metric was generated to correspond to the Legacy Telemetry enumerated
      histogram WEBFONT_COMPRESSION_WOFF2.
    range_min: 0
    range_max: 50
    bucket_count: 51
    histogram_type: linear
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1950710
    notification_emails:
      - jkew@mozilla.com
    expires: never
    telemetry_mirror: WEBFONT_COMPRESSION_WOFF2

webgpu:
  expose_adapter:
    type: dual_labeled_counter
    description: >
      The number of times wgpu-hal tried to expose an adapter.
      Note that a call to `requestAdapter` might result in multiple
      calls to expose adapter.
    dual_labels:
      key:
        description: >
          A backend-specific description of the adapter.
          See `gfx/wgpu_bindings/src/telemetry.rs` for more details.
      category:
        description: >
          The result of trying to expose the adapter.
          Either success or failure, both containing additional information.
          See `gfx/wgpu_bindings/src/telemetry.rs` for more details.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1980057
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1980057
    data_sensitivity:
      - technical
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
    expires: never
