module Sidekiq::Canary

Constants

VERSION

Public Instance Methods

canary_percent(default) click to toggle source
# File lib/sidekiq/canary.rb, line 16
def canary_percent(default)
  ENV["#{default.upcase}_CANARY_PERCENT"].to_i
end
get_sidekiq_options() click to toggle source
Calls superclass method
# File lib/sidekiq/canary.rb, line 3
def get_sidekiq_options
  options = super
  options.merge('queue' => queue(options["queue"]))
end
queue(default) click to toggle source
# File lib/sidekiq/canary.rb, line 8
def queue(default)
  use_canary_queue?(default) ? "#{default}_canary" : default
end
use_canary_queue?(default) click to toggle source
# File lib/sidekiq/canary.rb, line 12
def use_canary_queue?(default)
  rand(100) < canary_percent(default)
end