Draft: Add state machine for better rollout tooling
This implements a base state machine that outlines the process workflow of experiment rollout as far as we currently understand it.
An experiment starts in an :off
state. You can run!
an experiment, which transitions it to a :running
state. A :running
experiment can be :paused
by using pause!
, or marked as :resolved
by using resolve!
(a variant can optionally be specified with resolve!(:variant_name)
). When an experiment is :paused
, it can be placed back into a :running
state, or can be ended using terminate!
(which marks the experiment as :resolved
to the control.)
The experiment state event methods are as follows:
-
run!
to transition from an:off
or:paused
state to a:running
state -
pause!
to transition from a:running
state to a:paused
state -
resolve!([variant_name])
to transition from a:running
or:paused
state to a:resolved
state using the specified variant (the first registered variant being the default) -
terminate!
to transition from a:running
or:paused
state to a:resolved
state using the control
Experiments in the following states will exhibit the specified behavior:
-
:off
immediately routes to the control and tracking events will be ignored -
:running
allow the rollout strategy to assign a behavior and events will be tracked -
:paused
immediately routes to the control behavior and tracking events will be ignored -
:resolved
immediately routes to the resolved behavior (as cached) and tracking events will be ignored
Edited by Jeremy Jackson