Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per-experiment sampling? #70

Open
jamesbrauman opened this issue Aug 22, 2017 · 2 comments
Open

Per-experiment sampling? #70

jamesbrauman opened this issue Aug 22, 2017 · 2 comments

Comments

@jamesbrauman
Copy link

When using the science method in the Scientist module, I want to supply an extra parameter that would be used inside the enabled? method to determine whether to run the experiment.

The intention is to be able to control, on a per-experiment basis, the percentage of time that the experiment will actually run.

Is something like this possible?

@jbarnette
Copy link
Contributor

@jamesbrauman That's a good idea! There's no interface for it right now, but I dig it.

@jamesbrauman
Copy link
Author

@jbarnette Thanks for replying. For further information, I'm presently doing something like this to achieve what I want:

science 'experiment-name' do |e|
  e.context percentage_enabled: 5
end

And then in the enabled? method in my experiment, I am doing:

def enabled?
  if context.key?(:percent_enabled)
    # ...
  else
    true
  end
end

And my preferred way of doing it would be to pass that to the science call:

science 'experiment-name', percent_enabled: 5 do |e|
  # ...
end

Would you like me to make a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants