Skip to content

Instantly share code, notes, and snippets.

@IanWhitney
Last active May 9, 2017 02:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IanWhitney/cb1919669f9c5927914997ef8288ff9e to your computer and use it in GitHub Desktop.
Save IanWhitney/cb1919669f9c5927914997ef8288ff9e to your computer and use it in GitHub Desktop.
sidekiq job classification
def classify_jobs(queue = 'default')
hsh = Hash.new{|hsh, key| hsh[key] = 0}
Sidekiq::Queue.new(queue).each do |j|
hsh[j.klass] += 1
end
puts hsh if hsh.values.any?(&:present?)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment