Copy as Markdown
Other Tools
// -*- mode: C++ -*-
// AUTOGENERATED BY glean_parser. DO NOT EDIT.
/* 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
#ifndef mozilla_GleanDomMediaMetrics_h
#define mozilla_GleanDomMediaMetrics_h
#include "mozilla/glean/bindings/MetricTypes.h"
namespace mozilla::glean {
namespace gmp {
/**
* generated from gmp.update_xml_fetch_result
*/
enum class UpdateXmlFetchResultLabel: uint16_t {
eCertPinSuccess = 0,
eCertPinNetRequestError = 1,
eCertPinNetTimeout = 2,
eCertPinAbort = 3,
eCertPinMissingData = 4,
eCertPinFailed = 5,
eCertPinInvalid = 6,
eCertPinXmlParseError = 7,
eCertPinUnknownError = 8,
eContentSigSuccess = 9,
eContentSigNetRequestError = 10,
eContentSigNetTimeout = 11,
eContentSigAbort = 12,
eContentSigMissingData = 13,
eContentSigFailed = 14,
eContentSigInvalid = 15,
eContentSigXmlParseError = 16,
eContentSigUnknownError = 17,
e__Other__,
};
/**
* The result of Gecko fetching an update.xml from Balrog. This captures 3 different data points: success or failure of the request, if cert pinning or content signatures were used to verify the result, and the reason for failure, if the request failed.
*/
constexpr impl::Labeled<impl::CounterMetric, UpdateXmlFetchResultLabel> update_xml_fetch_result(3654);
}
namespace media {
/**
* generated from media.audible_play_time_percent
* Percentage of time spent playing media with an audible audio track, regardless of the volume. Keyed by audio-only or video presence.
* This metric was generated to correspond to the Legacy Telemetry linear histogram AUDIBLE_PLAY_TIME_PERCENT.
*/
constexpr impl::Labeled<impl::CustomDistributionMetric, DynamicLabel> audible_play_time_percent(3655);
/**
* generated from media.codec_used
* Count of use of audio/video codecs in HTMLMediaElements and WebAudio. Those with 'resource' prefix are approximate; report based on HTTP ContentType or sniffing. Those with 'webaudio' prefix are for WebAudio.
* This metric was generated to correspond to the Legacy Telemetry count histogram MEDIA_CODEC_USED.
*/
constexpr impl::Labeled<impl::CounterMetric, DynamicLabel> codec_used(3656);
/**
* generated from media.element_in_page_count
* The number of times a document hierarchy contained at least one HTMLMediaElement. In addition, the telemetry probe 'MIXED_CONTENT_UNBLOCK_COUNTER' records the total number of loaded top level content documents, which can help us calculate the result of the percentage of documents using media. This metric was generated to correspond to the Legacy Telemetry scalar media.element_in_page_count.
*/
constexpr impl::CounterMetric element_in_page_count(3657);
/**
* generated from media.error
*/
struct ErrorExtra {
mozilla::Maybe<nsCString> errorName;
mozilla::Maybe<nsCString> errorType;
mozilla::Maybe<nsCString> keySystem;
std::tuple<nsTArray<nsCString>, nsTArray<nsCString>> ToFfiExtra() const {
nsTArray<nsCString> extraKeys;
nsTArray<nsCString> extraValues;
if (errorName) {
extraKeys.AppendElement()->AssignASCII("error_name");
extraValues.EmplaceBack(errorName.value());
}
if (errorType) {
extraKeys.AppendElement()->AssignASCII("error_type");
extraValues.EmplaceBack(errorType.value());
}
if (keySystem) {
extraKeys.AppendElement()->AssignASCII("key_system");
extraValues.EmplaceBack(keySystem.value());
}
return std::make_tuple(std::move(extraKeys), std::move(extraValues));
}
};
/**
* Record the error details happened on a media element.
*/
constexpr impl::EventMetric<ErrorExtra> error(3658);
/**
* generated from media.media_play_time
* Total time spent playing media in milliseconds, keyed by its content (Audio and video, audio only, video only, audio and video but audio inaudible, audio and video but audio muted).
* This metric was generated to correspond to the Legacy Telemetry exponential histogram MEDIA_PLAY_TIME_MS.
*/
constexpr impl::Labeled<impl::TimingDistributionMetric, DynamicLabel> media_play_time(3659);
/**
* generated from media.mse_source_buffer_type
*/
enum class MseSourceBufferTypeLabel: uint16_t {
eVideohevc = 0,
eVideowebm = 1,
eAudiowebm = 2,
eVideomp4 = 3,
eAudiomp4 = 4,
eVideomp2t = 5,
eAudiomp2t = 6,
eAudiompeg = 7,
eAudioaac = 8,
e__Other__,
};
/**
* Count the actual or possible (because we don't support some of them for now) usage amount for each media mime type used in MSE. We collect this data in MediaSource's `AddSourceBuffer()` and `IsTypeSupported()`.
* This metric was generated to correspond to the Legacy Telemetry categorical histogram MSE_SOURCE_BUFFER_TYPE.
*/
constexpr impl::Labeled<impl::CounterMetric, MseSourceBufferTypeLabel> mse_source_buffer_type(3660);
/**
* generated from media.muted_play_time_percent
* Percentage of time spent playing media that has an audio track, with the audio muted. Keyed by audio-only or video presence.
* This metric was generated to correspond to the Legacy Telemetry linear histogram MUTED_PLAY_TIME_PERCENT.
*/
constexpr impl::Labeled<impl::CustomDistributionMetric, DynamicLabel> muted_play_time_percent(3661);
/**
* generated from media.video_clearkey_play_time
* Total time spent playing Clearkey encrypted video in milliseconds.
* This metric was generated to correspond to the Legacy Telemetry exponential histogram VIDEO_CLEARKEY_PLAY_TIME_MS.
*/
constexpr impl::TimingDistributionMetric video_clearkey_play_time(3662);
/**
* generated from media.video_dropped_compositor_frames_proportion_exponential
* Ratio of compositor dropped frames per total decoded frames scaled by 10,000 between starting and stopping a video
* This metric was generated to correspond to the Legacy Telemetry exponential histogram VIDEO_DROPPED_COMPOSITOR_FRAMES_PROPORTION_EXPONENTIAL.
*/
constexpr impl::CustomDistributionMetric video_dropped_compositor_frames_proportion_exponential(3663);
/**
* generated from media.video_dropped_decoded_frames_proportion_exponential
* Ratio of decoder dropped frames per total decoded frames scaled by 10,000 between starting and stopping a video
* This metric was generated to correspond to the Legacy Telemetry exponential histogram VIDEO_DROPPED_DECODED_FRAMES_PROPORTION_EXPONENTIAL.
*/
constexpr impl::CustomDistributionMetric video_dropped_decoded_frames_proportion_exponential(3664);
/**
* generated from media.video_dropped_frames_proportion
* Percentage of frames decoded frames dropped between starting and stopping a video
* This metric was generated to correspond to the Legacy Telemetry linear histogram VIDEO_DROPPED_FRAMES_PROPORTION.
*/
constexpr impl::CustomDistributionMetric video_dropped_frames_proportion(3665);
/**
* generated from media.video_dropped_frames_proportion_exponential
* Ratio of dropped frames per total decoded frames scaled by 10,000 between starting and stopping a video
* This metric was generated to correspond to the Legacy Telemetry exponential histogram VIDEO_DROPPED_FRAMES_PROPORTION_EXPONENTIAL.
*/
constexpr impl::CustomDistributionMetric video_dropped_frames_proportion_exponential(3666);
/**
* generated from media.video_dropped_sink_frames_proportion_exponential
* Ratio of sink dropped frames per total decoded frames scaled by 10,000 between starting and stopping a video
* This metric was generated to correspond to the Legacy Telemetry exponential histogram VIDEO_DROPPED_SINK_FRAMES_PROPORTION_EXPONENTIAL.
*/
constexpr impl::CustomDistributionMetric video_dropped_sink_frames_proportion_exponential(3667);
/**
* generated from media.video_encrypted_play_time
* Total time spent playing encrypted video in milliseconds.
* This metric was generated to correspond to the Legacy Telemetry exponential histogram VIDEO_ENCRYPTED_PLAY_TIME_MS.
*/
constexpr impl::TimingDistributionMetric video_encrypted_play_time(3668);
/**
* generated from media.video_hardware_decoding_support
* Record whether hardware decoding is supported for the specific video codec. The key is the type of video codec, eg. video/vp9. This metric was generated to correspond to the Legacy Telemetry scalar media.video_hardware_decoding_support.
*/
constexpr impl::Labeled<impl::BooleanMetric, DynamicLabel> video_hardware_decoding_support(3669);
/**
* generated from media.video_hd_hardware_decoding_support
* Record whether hardware decoding is supported for the specific video codec, this only records video in HD (1280*720) or higher resultion. The key is the type of video codec, eg. video/vp9. This metric was generated to correspond to the Legacy Telemetry scalar media.video_hd_hardware_decoding_support.
*/
constexpr impl::Labeled<impl::BooleanMetric, DynamicLabel> video_hd_hardware_decoding_support(3670);
/**
* generated from media.video_hdr_play_time
* Total time spent playing HDR video in milliseconds.
* This metric was generated to correspond to the Legacy Telemetry exponential histogram VIDEO_HDR_PLAY_TIME_MS.
*/
constexpr impl::TimingDistributionMetric video_hdr_play_time(3671);
/**
* generated from media.video_hidden_play_time
* Total time spent playing video while element is hidden, in milliseconds.
* This metric was generated to correspond to the Legacy Telemetry exponential histogram VIDEO_HIDDEN_PLAY_TIME_MS.
*/
constexpr impl::TimingDistributionMetric video_hidden_play_time(3672);
/**
* generated from media.video_hidden_play_time_percentage
* Percentage of total time spent playing video while element is hidden. Keyed by audio presence and by height ranges (boundaries: 240. 480, 576, 720, 1080, 2160), e.g.: 'V,0<h<=240', 'AV,h>2160'; and 'All' will accumulate all percentages. This is reported whenever the decoder stops. (eg. pausing media, encountering an error, changing to a new resource, page goes to the bf-cached or page gets discarded)
* This metric was generated to correspond to the Legacy Telemetry linear histogram VIDEO_HIDDEN_PLAY_TIME_PERCENTAGE.
*/
constexpr impl::Labeled<impl::CustomDistributionMetric, DynamicLabel> video_hidden_play_time_percentage(3673);
/**
* generated from media.video_play_time
* Total time spent playing video in milliseconds.
* This metric was generated to correspond to the Legacy Telemetry exponential histogram VIDEO_PLAY_TIME_MS.
*/
constexpr impl::TimingDistributionMetric video_play_time(3674);
/**
* generated from media.video_visible_play_time
* Total time spent playing visible video in milliseconds.
* This metric was generated to correspond to the Legacy Telemetry exponential histogram VIDEO_VISIBLE_PLAY_TIME_MS.
*/
constexpr impl::Labeled<impl::TimingDistributionMetric, DynamicLabel> video_visible_play_time(3675);
/**
* generated from media.video_widevine_play_time
* Total time spent playing Widevine encrypted video in milliseconds.
* This metric was generated to correspond to the Legacy Telemetry exponential histogram VIDEO_WIDEVINE_PLAY_TIME_MS.
*/
constexpr impl::TimingDistributionMetric video_widevine_play_time(3676);
}
namespace media_audio {
/**
* generated from media.audio.backend
*/
enum class BackendLabel: uint16_t {
eUnknown = 0,
eAudiounit = 1,
eAudiounitRust = 2,
eAaudio = 3,
eOpensl = 4,
eWasapi = 5,
eWinmm = 6,
eAlsa = 7,
eJack = 8,
eOss = 9,
ePulse = 10,
ePulseRust = 11,
eSndio = 12,
eSunaudio = 13,
e__Other__,
};
/**
* The operating system audio backend (Migrated from the geckoview metric of the same name).
*/
constexpr impl::Labeled<impl::CounterMetric, BackendLabel> backend(3678);
/**
* generated from media.audio.init_failure
*/
enum class InitFailureLabel: uint16_t {
eFirst = 0,
eOther = 1,
e__Other__,
};
/**
* Failure occurs when initializing the audio stream. (Migrated from the geckoview metric of the same name).
*/
constexpr impl::Labeled<impl::CounterMetric, InitFailureLabel> init_failure(3679);
}
namespace media_playback {
/**
* generated from media.playback.decode_error
*/
struct DecodeErrorExtra {
mozilla::Maybe<nsCString> decoderName;
mozilla::Maybe<nsCString> errorName;
mozilla::Maybe<bool> isHardwareAccelerated;
mozilla::Maybe<nsCString> keySystem;
mozilla::Maybe<nsCString> mimeType;
std::tuple<nsTArray<nsCString>, nsTArray<nsCString>> ToFfiExtra() const {
nsTArray<nsCString> extraKeys;
nsTArray<nsCString> extraValues;
if (decoderName) {
extraKeys.AppendElement()->AssignASCII("decoder_name");
extraValues.EmplaceBack(decoderName.value());
}
if (errorName) {
extraKeys.AppendElement()->AssignASCII("error_name");
extraValues.EmplaceBack(errorName.value());
}
if (isHardwareAccelerated) {
extraKeys.AppendElement()->AssignASCII("is_hardware_accelerated");
extraValues.AppendElement()->AssignASCII(isHardwareAccelerated.value() ? "true" : "false");
}
if (keySystem) {
extraKeys.AppendElement()->AssignASCII("key_system");
extraValues.EmplaceBack(keySystem.value());
}
if (mimeType) {
extraKeys.AppendElement()->AssignASCII("mime_type");
extraValues.EmplaceBack(mimeType.value());
}
return std::make_tuple(std::move(extraKeys), std::move(extraValues));
}
};
/**
* Record the decode error details.
*/
constexpr impl::EventMetric<DecodeErrorExtra> decode_error(3680);
/**
* generated from media.playback.device_hardware_decoder_support
*/
enum class DeviceHardwareDecoderSupportLabel: uint16_t {
eH264 = 0,
eVp8 = 1,
eVp9 = 2,
eAv1 = 3,
eHevc = 4,
e__Other__,
};
/**
* The results of hardware decoder support for different video codecs. True means that codec can be decoded by hardware on user's device.
*/
constexpr impl::Labeled<impl::BooleanMetric, DeviceHardwareDecoderSupportLabel> device_hardware_decoder_support(3681);
/**
* generated from media.playback.first_frame_loaded
*/
struct FirstFrameLoadedExtra {
mozilla::Maybe<uint32_t> bufferingTime;
mozilla::Maybe<nsCString> decoderName;
mozilla::Maybe<uint32_t> firstFrameLoadedTime;
mozilla::Maybe<bool> hlsDecoder;
mozilla::Maybe<bool> isHardwareDecoding;
mozilla::Maybe<bool> isHdr;
mozilla::Maybe<nsCString> keySystem;
mozilla::Maybe<uint32_t> metadataLoadedTime;
mozilla::Maybe<nsCString> playbackType;
mozilla::Maybe<nsCString> resolution;
mozilla::Maybe<uint32_t> totalWaitingDataTime;
mozilla::Maybe<nsCString> videoCodec;
std::tuple<nsTArray<nsCString>, nsTArray<nsCString>> ToFfiExtra() const {
nsTArray<nsCString> extraKeys;
nsTArray<nsCString> extraValues;
if (bufferingTime) {
extraKeys.AppendElement()->AssignASCII("buffering_time");
extraValues.AppendElement()->AppendInt(bufferingTime.value());
}
if (decoderName) {
extraKeys.AppendElement()->AssignASCII("decoder_name");
extraValues.EmplaceBack(decoderName.value());
}
if (firstFrameLoadedTime) {
extraKeys.AppendElement()->AssignASCII("first_frame_loaded_time");
extraValues.AppendElement()->AppendInt(firstFrameLoadedTime.value());
}
if (hlsDecoder) {
extraKeys.AppendElement()->AssignASCII("hls_decoder");
extraValues.AppendElement()->AssignASCII(hlsDecoder.value() ? "true" : "false");
}
if (isHardwareDecoding) {
extraKeys.AppendElement()->AssignASCII("is_hardware_decoding");
extraValues.AppendElement()->AssignASCII(isHardwareDecoding.value() ? "true" : "false");
}
if (isHdr) {
extraKeys.AppendElement()->AssignASCII("is_hdr");
extraValues.AppendElement()->AssignASCII(isHdr.value() ? "true" : "false");
}
if (keySystem) {
extraKeys.AppendElement()->AssignASCII("key_system");
extraValues.EmplaceBack(keySystem.value());
}
if (metadataLoadedTime) {
extraKeys.AppendElement()->AssignASCII("metadata_loaded_time");
extraValues.AppendElement()->AppendInt(metadataLoadedTime.value());
}
if (playbackType) {
extraKeys.AppendElement()->AssignASCII("playback_type");
extraValues.EmplaceBack(playbackType.value());
}
if (resolution) {
extraKeys.AppendElement()->AssignASCII("resolution");
extraValues.EmplaceBack(resolution.value());
}
if (totalWaitingDataTime) {
extraKeys.AppendElement()->AssignASCII("total_waiting_data_time");
extraValues.AppendElement()->AppendInt(totalWaitingDataTime.value());
}
if (videoCodec) {
extraKeys.AppendElement()->AssignASCII("video_codec");
extraValues.EmplaceBack(videoCodec.value());
}
return std::make_tuple(std::move(extraKeys), std::move(extraValues));
}
};
/**
* The time that the media pipeline takes to load the first video frame.
*/
constexpr impl::EventMetric<FirstFrameLoadedExtra> first_frame_loaded(3682);
/**
* generated from media.playback.not_supported_video_per_mime_type
* Count the amount of times where video playback is failed to start due to the mime type is not supported by Firefox. The result is accumulated per mime type, eg. video/hevc.
*/
constexpr impl::Labeled<impl::CounterMetric, DynamicLabel> not_supported_video_per_mime_type(3683);
}
} // namespace mozilla::glean
#endif // mozilla_GleanDomMediaMetrics_h