1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
// 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 https://mozilla.org/MPL/2.0/.
//! This file contains the Generated Glean Metrics API
//!
//! The contents of this module are generated by
//! `toolkit/components/glean/build_scripts/glean_parser_ext/run_glean_parser.py`, from
//! 'toolkit/components/glean/metrics.yaml`.
#[cfg(not(feature = "cargo-clippy"))]
include!(concat!(
env!("MOZ_TOPOBJDIR"),
"/toolkit/components/glean/api/src/metrics.rs"
));
// When running clippy the linter, `MOZ_TOPOBJDIR` is not set
// (and the `metrics.rs` file might not even be generated yet),
// so we need to manually define some things we expect from it so the rest of the build can assume
// it's there.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1674726.
#[cfg(feature = "cargo-clippy")]
#[allow(dead_code)]
pub(crate) mod __glean_metric_maps {
use std::collections::HashMap;
use crate::private::*;
use once_cell::sync::Lazy;
pub static TIMESPAN_MAP: Lazy<HashMap<MetricId, &Lazy<TimespanMetric>>> =
Lazy::new(HashMap::new);
pub static COUNTER_MAP: Lazy<HashMap<MetricId, &Lazy<CounterMetric>>> = Lazy::new(HashMap::new);
pub static BOOLEAN_MAP: Lazy<HashMap<MetricId, &Lazy<BooleanMetric>>> = Lazy::new(HashMap::new);
pub static DATETIME_MAP: Lazy<HashMap<MetricId, &Lazy<DatetimeMetric>>> =
Lazy::new(HashMap::new);
pub static STRING_MAP: Lazy<HashMap<MetricId, &Lazy<StringMetric>>> = Lazy::new(HashMap::new);
pub static MEMORY_DISTRIBUTION_MAP: Lazy<HashMap<MetricId, &Lazy<MemoryDistributionMetric>>> =
Lazy::new(HashMap::new);
pub static STRING_LIST_MAP: Lazy<HashMap<MetricId, &Lazy<StringListMetric>>> =
Lazy::new(HashMap::new);
pub static UUID_MAP: Lazy<HashMap<MetricId, &Lazy<UuidMetric>>> = Lazy::new(HashMap::new);
pub(crate) fn event_record_wrapper(
_metric_id: u32,
_extra: Option<HashMap<i32, String>>,
) -> Result<(), EventRecordingError> {
Err(EventRecordingError::InvalidId)
}
pub(crate) fn event_record_wrapper_str(
_metric_id: u32,
_extra: Option<HashMap<String, String>>,
) -> Result<(), EventRecordingError> {
Err(EventRecordingError::InvalidId)
}
pub(crate) fn event_test_get_value_wrapper(
_metric_id: u32,
_storage_name: &str,
) -> Option<Vec<RecordedEvent>> {
None
}
}
|