# 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: Canvas2D'

canvas:
  used_2d:
    type: labeled_counter
    description: >
      2D canvas used

      This metric was generated to correspond to the Legacy Telemetry boolean
      histogram CANVAS_2D_USED.
    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#CANVAS_2D_USED

  webgl_accl_failure_id:
    type: labeled_counter
    description: >
      Track the failure IDs that lead us to reject attempting to create an
      accelerated context. CANVAS_WEBGL_FAILURE_ID reports the overall WebGL
      status with the attempt to fallback.

      This metric was generated to correspond to the Legacy Telemetry count
      histogram CANVAS_WEBGL_ACCL_FAILURE_ID.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1272808
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1272808
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - rhunt@mozilla.com
    expires: never
    telemetry_mirror: h#CANVAS_WEBGL_ACCL_FAILURE_ID

  webgl_failure_id:
    type: labeled_counter
    description: >
      WebGL runtime and dynamic failure IDs. This will record a count for each
      context creation success or failure. Each failure id is a unique
      identifier that can be traced back to a particular failure branch or
      blocklist rule.

      This metric was generated to correspond to the Legacy Telemetry count
      histogram CANVAS_WEBGL_FAILURE_ID.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1272808
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1272808
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - rhunt@mozilla.com
    expires: never
    telemetry_mirror: h#CANVAS_WEBGL_FAILURE_ID

  webgl_success:
    type: labeled_counter
    description: >
      WebGL1 creation success

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

  webgl_used:
    type: labeled_counter
    description: >
      WebGL canvas used

      This metric was generated to correspond to the Legacy Telemetry boolean
      histogram CANVAS_WEBGL_USED.
    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#CANVAS_WEBGL_USED

  webgl2_success:
    type: labeled_counter
    description: >
      WebGL2 creation success

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