* Moving Experiments into AbExperiment namespace This commit entails two major concepts: 1. Extracting logic out of a worker. 2. Cleaning the conditions in which we convert experiments. In addition, I revisited some spec names to tidy them up for clarification and structure. **Extracting Logic...** For workers, my preference is that they be a simple router to another object. A non-worker object, with it's initialize method, can both better manage instance variables. Further, workers are somewhat "flat" in hierarchy, In this case, having the AbExperiment be knowledgeable both in setting the experiment and handling conversions makes (to me) organizational sense. For example, the AbExperiment is constructed as a wrapper to the FieldTest gem. But the RecordFieldTestEventWorker had knowledge of FieldTest. With this refactor, it does not have that knowledge. This also provided an opportunity to replace magic strings with constants. **Cleaning the conditions...** This relates directly to and closes forem/forem#17530. I was looking at the experiments after 2 days, and realized that there shouldn't be results for `user_views_pages_on_at_least_nine_different_days_within_two_weeks`; after all the experiment started 2 days ago, how can we have results that look at 2 weeks. By adding the "max" function calls, we ensure a clear boundary of "before the experiment began" versus "while the experiment is running". Closes forem/forem#17530 * Update spec/models/ab_experiment_spec.rb Co-authored-by: Mac Siri <krairit.siri@gmail.com> * Apply suggestions from code review Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com> Co-authored-by: Mac Siri <krairit.siri@gmail.com> Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
30 lines
1.1 KiB
YAML
30 lines
1.1 KiB
YAML
# See AbExperiment namespace for details of goals and variants
|
|
experiments:
|
|
# NOTE: Our feed strategy testing experiment must begin with "feed_strategy"
|
|
feed_strategy_starting_20220422:
|
|
# NOTE: Required as we want only want to consider for conversion events that
|
|
# occurred on or after the given start_date.
|
|
start_date: 2022-04-22
|
|
variants:
|
|
- 20220415-incumbent
|
|
- 20220422-jennie-variant
|
|
weights:
|
|
- 80
|
|
- 20
|
|
goals:
|
|
- user_creates_comment
|
|
- user_creates_comment_on_at_least_four_different_days_within_a_week
|
|
- user_views_pages_on_at_least_four_different_days_within_a_week
|
|
- user_views_pages_on_at_least_four_different_hours_within_a_day
|
|
- user_views_pages_on_at_least_nine_different_days_within_two_weeks
|
|
- user_views_pages_on_at_least_twelve_different_hours_within_five_days
|
|
exclude:
|
|
bots: true
|
|
|
|
# Dashboard performance
|
|
cache: true
|
|
precision: 2
|
|
|
|
# For logged-in users we'll explicitly pass participant.
|
|
# If we experiment on non-logged in, we don't want to collect cookies anyway.
|
|
cookies: false
|