1
1
// -*- mode: Swift -*-
2
2
3
- // AUTOGENERATED BY glean_parser. DO NOT EDIT. DO NOT COMMIT.
3
+ // AUTOGENERATED BY glean_parser v6.1.1 . DO NOT EDIT. DO NOT COMMIT.
4
4
5
5
/* This Source Code Form is subject to the terms of the Mozilla Public
6
6
* License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -22,7 +22,7 @@ extension GleanMetrics {
22
22
// Intentionally left private, no external user can instantiate a new global object.
23
23
}
24
24
25
- public static let info = BuildInfo ( buildDate: DateComponents ( calendar: Calendar . current, timeZone: TimeZone ( abbreviation: " UTC " ) , year: 2022 , month: 6 , day: 7 , hour: 15 , minute: 6 , second: 51 ) )
25
+ public static let info = BuildInfo ( buildDate: DateComponents ( calendar: Calendar . current, timeZone: TimeZone ( abbreviation: " UTC " ) , year: 2022 , month: 6 , day: 16 , hour: 18 , minute: 44 , second: 22 ) )
26
26
}
27
27
28
28
enum NimbusEvents {
@@ -31,24 +31,20 @@ extension GleanMetrics {
31
31
var enrollmentId : String ?
32
32
var experiment : String ?
33
33
34
- func toFfiExtra( ) -> ( [ Int32 ] , [ String ] ) {
35
- var keys = [ Int32] ( )
36
- var values = [ String] ( )
34
+ func toExtraRecord( ) -> [ String : String ] {
35
+ var record = [ String: String] ( )
37
36
38
37
if let branch = self . branch {
39
- keys. append ( 0 )
40
- values. append ( String ( branch) )
38
+ record [ " branch " ] = String ( branch)
41
39
}
42
40
if let enrollmentId = self . enrollmentId {
43
- keys. append ( 1 )
44
- values. append ( String ( enrollmentId) )
41
+ record [ " enrollment_id " ] = String ( enrollmentId)
45
42
}
46
43
if let experiment = self . experiment {
47
- keys. append ( 2 )
48
- values. append ( String ( experiment) )
44
+ record [ " experiment " ] = String ( experiment)
49
45
}
50
46
51
- return ( keys , values )
47
+ return record
52
48
}
53
49
}
54
50
@@ -57,24 +53,20 @@ extension GleanMetrics {
57
53
var enrollmentId : String ?
58
54
var experiment : String ?
59
55
60
- func toFfiExtra( ) -> ( [ Int32 ] , [ String ] ) {
61
- var keys = [ Int32] ( )
62
- var values = [ String] ( )
56
+ func toExtraRecord( ) -> [ String : String ] {
57
+ var record = [ String: String] ( )
63
58
64
59
if let branch = self . branch {
65
- keys. append ( 0 )
66
- values. append ( String ( branch) )
60
+ record [ " branch " ] = String ( branch)
67
61
}
68
62
if let enrollmentId = self . enrollmentId {
69
- keys. append ( 1 )
70
- values. append ( String ( enrollmentId) )
63
+ record [ " enrollment_id " ] = String ( enrollmentId)
71
64
}
72
65
if let experiment = self . experiment {
73
- keys. append ( 2 )
74
- values. append ( String ( experiment) )
66
+ record [ " experiment " ] = String ( experiment)
75
67
}
76
68
77
- return ( keys , values )
69
+ return record
78
70
}
79
71
}
80
72
@@ -83,24 +75,20 @@ extension GleanMetrics {
83
75
var enrollmentId : String ?
84
76
var experiment : String ?
85
77
86
- func toFfiExtra( ) -> ( [ Int32 ] , [ String ] ) {
87
- var keys = [ Int32] ( )
88
- var values = [ String] ( )
78
+ func toExtraRecord( ) -> [ String : String ] {
79
+ var record = [ String: String] ( )
89
80
90
81
if let branch = self . branch {
91
- keys. append ( 0 )
92
- values. append ( String ( branch) )
82
+ record [ " branch " ] = String ( branch)
93
83
}
94
84
if let enrollmentId = self . enrollmentId {
95
- keys. append ( 1 )
96
- values. append ( String ( enrollmentId) )
85
+ record [ " enrollment_id " ] = String ( enrollmentId)
97
86
}
98
87
if let experiment = self . experiment {
99
- keys. append ( 2 )
100
- values. append ( String ( experiment) )
88
+ record [ " experiment " ] = String ( experiment)
101
89
}
102
90
103
- return ( keys , values )
91
+ return record
104
92
}
105
93
}
106
94
@@ -109,122 +97,136 @@ extension GleanMetrics {
109
97
var enrollmentId : String ?
110
98
var experiment : String ?
111
99
112
- func toFfiExtra( ) -> ( [ Int32 ] , [ String ] ) {
113
- var keys = [ Int32] ( )
114
- var values = [ String] ( )
100
+ func toExtraRecord( ) -> [ String : String ] {
101
+ var record = [ String: String] ( )
115
102
116
103
if let branch = self . branch {
117
- keys. append ( 0 )
118
- values. append ( String ( branch) )
104
+ record [ " branch " ] = String ( branch)
119
105
}
120
106
if let enrollmentId = self . enrollmentId {
121
- keys. append ( 1 )
122
- values. append ( String ( enrollmentId) )
107
+ record [ " enrollment_id " ] = String ( enrollmentId)
123
108
}
124
109
if let experiment = self . experiment {
125
- keys. append ( 2 )
126
- values. append ( String ( experiment) )
110
+ record [ " experiment " ] = String ( experiment)
127
111
}
128
112
129
- return ( keys , values )
113
+ return record
130
114
}
131
115
}
132
116
133
117
/// Recorded when a user has met the conditions and is first bucketed into an
134
118
/// experiment (i.e. targeting matched and they were randomized into a bucket and
135
119
/// branch of the experiment). Expected a maximum of once per experiment per user.
136
120
static let enrollment = EventMetricType < NoExtraKeys , EnrollmentExtra > ( // generated from nimbus_events.enrollment
137
- category: " nimbus_events " ,
138
- name: " enrollment " ,
139
- sendInPings: [ " events " ] ,
140
- lifetime: . ping,
141
- disabled: false ,
142
- allowedExtraKeys: [ " branch " , " enrollment_id " , " experiment " ]
121
+ CommonMetricData (
122
+ category: " nimbus_events " ,
123
+ name: " enrollment " ,
124
+ sendInPings: [ " events " ] ,
125
+ lifetime: . ping,
126
+ disabled: false
127
+ )
128
+ , [ " branch " , " enrollment_id " , " experiment " ]
143
129
)
144
130
145
131
/// Recorded when either telemetry is disabled, or the experiment has run for its
146
132
/// designed duration (i.e. it is no longer present in the Nimbus Remote Settings
147
133
/// collection)
148
134
static let unenrollment = EventMetricType < NoExtraKeys , UnenrollmentExtra > ( // generated from nimbus_events.unenrollment
149
- category: " nimbus_events " ,
150
- name: " unenrollment " ,
151
- sendInPings: [ " events " ] ,
152
- lifetime: . ping,
153
- disabled: false ,
154
- allowedExtraKeys: [ " branch " , " enrollment_id " , " experiment " ]
135
+ CommonMetricData (
136
+ category: " nimbus_events " ,
137
+ name: " unenrollment " ,
138
+ sendInPings: [ " events " ] ,
139
+ lifetime: . ping,
140
+ disabled: false
141
+ )
142
+ , [ " branch " , " enrollment_id " , " experiment " ]
155
143
)
156
144
157
145
/// Recorded when a user becomes ineligible to continue receiving the treatment for
158
146
/// an enrolled experiment, for reasons such as the user opting out of the
159
147
/// experiment or no longer matching targeting for the experiment.
160
148
static let disqualification = EventMetricType < NoExtraKeys , DisqualificationExtra > ( // generated from nimbus_events.disqualification
161
- category: " nimbus_events " ,
162
- name: " disqualification " ,
163
- sendInPings: [ " events " ] ,
164
- lifetime: . ping,
165
- disabled: false ,
166
- allowedExtraKeys: [ " branch " , " enrollment_id " , " experiment " ]
149
+ CommonMetricData (
150
+ category: " nimbus_events " ,
151
+ name: " disqualification " ,
152
+ sendInPings: [ " events " ] ,
153
+ lifetime: . ping,
154
+ disabled: false
155
+ )
156
+ , [ " branch " , " enrollment_id " , " experiment " ]
167
157
)
168
158
169
159
/// Recorded when a user actually observes an experimental treatment, or would have
170
160
/// observed an experimental treatment if they had been in a branch that would have
171
161
/// shown one.
172
162
static let exposure = EventMetricType < NoExtraKeys , ExposureExtra > ( // generated from nimbus_events.exposure
173
- category: " nimbus_events " ,
174
- name: " exposure " ,
175
- sendInPings: [ " events " ] ,
176
- lifetime: . ping,
177
- disabled: false ,
178
- allowedExtraKeys: [ " branch " , " enrollment_id " , " experiment " ]
163
+ CommonMetricData (
164
+ category: " nimbus_events " ,
165
+ name: " exposure " ,
166
+ sendInPings: [ " events " ] ,
167
+ lifetime: . ping,
168
+ disabled: false
169
+ )
170
+ , [ " branch " , " enrollment_id " , " experiment " ]
179
171
)
180
172
181
173
}
182
174
183
175
enum LoginsStoreMigration {
184
176
/// The total number of login records processed by the migration
185
177
static let numProcessed = CounterMetricType ( // generated from logins_store_migration.num_processed
186
- category: " logins_store_migration " ,
187
- name: " num_processed " ,
188
- sendInPings: [ " metrics " ] ,
189
- lifetime: . ping,
190
- disabled: false
178
+ CommonMetricData (
179
+ category: " logins_store_migration " ,
180
+ name: " num_processed " ,
181
+ sendInPings: [ " metrics " ] ,
182
+ lifetime: . ping,
183
+ disabled: false
184
+ )
191
185
)
192
186
193
187
/// The total number of login records successfully migrated
194
188
static let numSucceeded = CounterMetricType ( // generated from logins_store_migration.num_succeeded
195
- category: " logins_store_migration " ,
196
- name: " num_succeeded " ,
197
- sendInPings: [ " metrics " ] ,
198
- lifetime: . ping,
199
- disabled: false
189
+ CommonMetricData (
190
+ category: " logins_store_migration " ,
191
+ name: " num_succeeded " ,
192
+ sendInPings: [ " metrics " ] ,
193
+ lifetime: . ping,
194
+ disabled: false
195
+ )
200
196
)
201
197
202
198
/// The total number of login records which failed to migrate
203
199
static let numFailed = CounterMetricType ( // generated from logins_store_migration.num_failed
204
- category: " logins_store_migration " ,
205
- name: " num_failed " ,
206
- sendInPings: [ " metrics " ] ,
207
- lifetime: . ping,
208
- disabled: false
200
+ CommonMetricData (
201
+ category: " logins_store_migration " ,
202
+ name: " num_failed " ,
203
+ sendInPings: [ " metrics " ] ,
204
+ lifetime: . ping,
205
+ disabled: false
206
+ )
209
207
)
210
208
211
209
/// How long the migration tool
212
210
static let totalDuration = TimespanMetricType ( // generated from logins_store_migration.total_duration
213
- category: " logins_store_migration " ,
214
- name: " total_duration " ,
215
- sendInPings: [ " metrics " ] ,
216
- lifetime: . ping,
217
- disabled: false ,
218
- timeUnit: . millisecond
211
+ CommonMetricData (
212
+ category: " logins_store_migration " ,
213
+ name: " total_duration " ,
214
+ sendInPings: [ " metrics " ] ,
215
+ lifetime: . ping,
216
+ disabled: false
217
+ )
218
+ , . millisecond
219
219
)
220
220
221
221
/// Errors discovered in the migration.
222
222
static let errors = StringListMetricType ( // generated from logins_store_migration.errors
223
- category: " logins_store_migration " ,
224
- name: " errors " ,
225
- sendInPings: [ " metrics " ] ,
226
- lifetime: . ping,
227
- disabled: false
223
+ CommonMetricData (
224
+ category: " logins_store_migration " ,
225
+ name: " errors " ,
226
+ sendInPings: [ " metrics " ] ,
227
+ lifetime: . ping,
228
+ disabled: false
229
+ )
228
230
)
229
231
230
232
}
0 commit comments