Method: Experiment::Notify.step

Defined in:
lib/experiment/notify.rb

.step(experiment, cv, num) ⇒ Object

Use this in experiment after each (potentially time consuming) task The argument should be a fraction (0 < num < 1) which tells how big a portion the task was of the complete run (eg. your calls should sum up to 1).



73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/experiment/notify.rb', line 73

def step(experiment, cv, num)
  if @mode == :normal
    if num > 1
      num = num / 100
    end
    inc(num)
    @cv_prog[experiment][cv] ||= 0
    @cv_prog[experiment][cv] += num
  else
    @mode.notify.step(experiment, cv, num)
  end
end