Files
notes/Facebook/sigma.md
2021-10-29 08:14:35 +01:00

1.4 KiB

How to input samples for the context

inputs <- H.sampleInputsFrom "sentry_confirm_email" 500

How to test inputs

map failOnError <$>
  T.batchTestHaxl (
    textShow . Map.lookup (QE.QEUniverse "registration_classifiers") <$>
      QE.enabledExperiments
  )
  inputs

How to find users with enabled GK

gk <-map failOnError <$> T.batchTestHaxl (if passesGKPreCalculated "reg_conf_contactpoint_mismatch" then fmapId else return 0) inputs
good_inputs = [ snd x | x <-  zip gk inputs, fst x /= 0 ]
gk <-map failOnError <$> T.batchTestHaxl (if passesGKPreCalculated "reg_conf_contactpoint_mismatch" then fmapId else return "") inputs
  1. The lazy one using exceptions.
inputs <- H.sampleInputsFrom "some_context" 1000
responses <- rights <$> T.batchTestPolicy (if passesGKExperiment "some_gk" then somePolicy else throw LogicError "An error") inputs
  1. The fancier one with conditions, that gives you more flexibility.
inputs <- H.sampleInputsFrom "some_context" 1000
passes <- map failOnError <$> T.batchTestHaxl (GK.passesGKExperiment "some_gk") inputs
inputs_gk = map (inputs !!) $ elemIndices True passes
responses <- T.batchTestPolicy somePolicy inputs_gk
gk <-map failOnError <$> T.batchTestHaxl (passesGKPreCalculated "reg_conf_contactpoint_mismatch") inputs

How to dump Input Map content

T.pasteString "Some input map" . textShow =<< pp <$> inputMap