-
Notifications
You must be signed in to change notification settings - Fork 95
Enabling or disabling experiments
Josh Hiles edited this page Dec 23, 2023
·
1 revision
Sometimes you don't want an experiment to run. Say, disabling a new codepath for anyone who isn't staff. You can disable an experiment by setting a RunIf
block. If this returns false
, the experiment will merely return the control value. Otherwise, it defers to the global Scientist.Enabled
method.
public decimal GetUserStatistic(IUser user)
{
return Scientist.Science<decimal>("new-statistic-calculation", experiment =>
{
experiment.RunIf(() => user.IsTestSubject);
experiment.Use(() => CalculateStatistic(user));
experiment.Try(() => NewCalculateStatistic(user));
});
}
- Publishing results
- Controlling comparison
- Adding context
- Expensive setup
- Keeping it clean
- Ignoring mismatches
- Enabling or disabling experiments
- Ramping up experiments
- Running candidates in parallel (asynchronous)
- Testing
- Handling errors
- Designing an experiment
- Finishing an experiment
Sometimes scientists just gotta do weird stuff. We understand.