Method: Split::Helper.ab_finished

Defined in:
lib/split/helper.rb

.ab_finished(metric_descriptor, options = { reset: true }) ⇒ Object



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/split/helper.rb', line 72

def ab_finished(metric_descriptor, options = { reset: true })
  return if exclude_visitor? || Split.configuration.disabled?
  metric_descriptor, goals = normalize_metric(metric_descriptor)
  experiments = Metric.possible_experiments(metric_descriptor)

  if experiments.any?
    experiments.each do |experiment|
      next if override_present?(experiment.key)
      finish_experiment(experiment, options.merge(goals: goals))
    end
  end
rescue => e
  raise unless Split.configuration.db_failover
  Split.configuration.db_failover_on_db_error.call(e)
end