@@ -49,6 +49,10 @@ preserve_data = not flush_on_shutdown -- should always be the inverse of f
4949
5050-- Specify an optional module to encode incoming messages via its encode function.
5151-- 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
5256```
5357--]]
5458
@@ -85,6 +89,10 @@ if experiment_dimensions then
8589 experiment_batch_dir = read_config (" experiment_batch_dir" ) or error (" experiment_batch_dir must be specified" )
8690 experiment_dimensions = mts3 .validate_dimensions (experiment_dimensions )
8791end
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" )
8896
8997
9098local function get_fqfn (dir , path )
@@ -190,6 +198,12 @@ local function process_standard_dimensions(data)
190198end
191199
192200
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+
193207local function process_experiment_dimensions (data , experiments )
194208 local ok , experiments = pcall (cjson .decode , experiments )
195209 if not ok then return end
@@ -198,11 +212,13 @@ local function process_experiment_dimensions(data, experiments)
198212 for id , exp in pairs (experiments ) do
199213 vars .experimentId = id
200214 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 )
204221 end
205- output_dimension (experiment_batch_dir , dims , data )
206222 end
207223end
208224
0 commit comments