Class: Gitlab::Experiment::Rollout::Random

Inherits:
Base
  • Object
show all
Defined in:
lib/gitlab/experiment/rollout/random.rb

Instance Attribute Summary

Attributes inherited from Base

#experiment

Instance Method Summary collapse

Methods inherited from Base

#initialize, #rollout_for, #validate!

Constructor Details

This class inherits a constructor from Gitlab::Experiment::Rollout::Base

Instance Method Details

#executeObject

Pick a random variant if we’re in the experiment group. It doesn’t take into account small sample sizes but is useful and performant.



9
10
11
# File 'lib/gitlab/experiment/rollout/random.rb', line 9

def execute
  variant_names.sample
end