@@ -49,6 +49,10 @@ preserve_data = not flush_on_shutdown -- should always be the inverse of f
49
49
50
50
-- Specify an optional module to encode incoming messages via its encode function.
51
51
-- encoder_module = "encoders.heka.framed_protobuf" -- default
52
+
53
+ -- Specifies experiment types whitelist, and experiment id blocklist
54
+ experiment_types = {["normandy-preference-"] = true} -- optional
55
+ experiment_blocklist = {["pref-flip-screenshots-release-1369150"] = true} -- optional
52
56
```
53
57
--]]
54
58
@@ -85,6 +89,10 @@ if experiment_dimensions then
85
89
experiment_batch_dir = read_config (" experiment_batch_dir" ) or error (" experiment_batch_dir must be specified" )
86
90
experiment_dimensions = mts3 .validate_dimensions (experiment_dimensions )
87
91
end
92
+ local experiment_types = read_config (" experiment_types" ) or {}
93
+ assert (type (experiment_types ) == " table" , " experiment_types must be a table" )
94
+ local experiment_blocklist = read_config (" experiment_blocklist" ) or {}
95
+ assert (type (experiment_blocklist ) == " table" , " experiment_blocklist must be a table" )
88
96
89
97
90
98
local function get_fqfn (dir , path )
@@ -190,6 +198,12 @@ local function process_standard_dimensions(data)
190
198
end
191
199
192
200
201
+ local function does_experiment_qualify (id , branch , experimentType )
202
+ return (not experimentType or experiment_types [experimentType ])
203
+ and not experiment_blocklist [id ]
204
+ end
205
+
206
+
193
207
local function process_experiment_dimensions (data , experiments )
194
208
local ok , experiments = pcall (cjson .decode , experiments )
195
209
if not ok then return end
@@ -198,11 +212,13 @@ local function process_experiment_dimensions(data, experiments)
198
212
for id , exp in pairs (experiments ) do
199
213
vars .experimentId = id
200
214
vars .experimentBranch = exp .branch
201
- local dims = {}
202
- for i ,d in ipairs (experiment_dimensions ) do
203
- dims [i ] = mts3 .read_dimension (d , vars )
215
+ if does_experiment_qualify (id , exp .branch , exp .type ) then
216
+ local dims = {}
217
+ for i ,d in ipairs (experiment_dimensions ) do
218
+ dims [i ] = mts3 .read_dimension (d , vars )
219
+ end
220
+ output_dimension (experiment_batch_dir , dims , data )
204
221
end
205
- output_dimension (experiment_batch_dir , dims , data )
206
222
end
207
223
end
208
224
0 commit comments