Last active
May 9, 2017 02:32
-
-
Save IanWhitney/cb1919669f9c5927914997ef8288ff9e to your computer and use it in GitHub Desktop.
sidekiq job classification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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