Skip to content

Throttle

Vinicius Stock edited this page Feb 19, 2019 · 1 revision

Throttle

Setting

Sail.set(:my_throttle_setting, 65.5)
Sail.set(:my_throttle_setting, "65.5")

Getting

Sail.get(:my_range_setting)
=> true

Sail.get(:my_range_setting) do |setting_value|
  puts setting_value
end
=> true

Examples

Throttle settings return true X% of the time, where X is the value of the setting. This can be used for a more controlled type of ab testing. For instance, if you want only 30% of the users to see a certain banner.

# app/views/pages/landing_page.html.erb

<div>
  .
  .
  .
  <% if Sail.get(:throttle_banner_presentation) %>
    <%= render(partial: "banner") %>
  <% end %>
</div>
Clone this wiki locally