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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// 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/.
use malloc_size_of_derive::MallocSizeOf;
use crate::metrics::PingType;
/// Glean-provided pings, all enabled by default.
///
/// These pings are defined in `glean-core/pings.yaml` and for now manually translated into Rust code.
/// This might get auto-generated when the Rust API lands ([Bug 1579146](https://bugzilla.mozilla.org/show_bug.cgi?id=1579146)).
///
/// They are parsed and registered by the platform-specific wrappers, but might be used Glean-internal directly.
#[derive(Debug, Clone, MallocSizeOf)]
pub struct InternalPings {
pub baseline: PingType,
pub metrics: PingType,
pub events: PingType,
pub health: PingType,
pub deletion_request: PingType,
}
impl InternalPings {
pub fn new(enabled: bool) -> InternalPings {
InternalPings {
baseline: PingType::new(
"baseline",
true,
true,
true,
true,
enabled,
vec![],
vec![
"active".to_string(),
"dirty_startup".to_string(),
"inactive".to_string(),
],
true,
vec![],
),
metrics: PingType::new(
"metrics",
true,
false,
true,
true,
enabled,
vec![],
vec![
"overdue".to_string(),
"reschedule".to_string(),
"today".to_string(),
"tomorrow".to_string(),
"upgrade".to_string(),
],
true,
vec![],
),
events: PingType::new(
"events",
true,
false,
true,
true,
enabled,
vec![],
vec![
"startup".to_string(),
"inactive".to_string(),
"max_capacity".to_string(),
],
true,
vec![],
),
health: PingType::new(
"health",
true,
true,
true,
true,
enabled,
vec![],
vec!["pre_init".to_string()],
true,
vec![],
),
deletion_request: PingType::new(
"deletion-request",
true,
true,
true,
true,
true, // The deletion-request should not be disabled
vec![],
vec!["at_init".to_string(), "set_upload_enabled".to_string()],
true,
vec![],
),
}
}
}