Skip to content

Instantly share code, notes, and snippets.

@WilliamQLiu
Forked from ngsmrk/sidekiq_monitoring
Created July 2, 2019 16:45
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 WilliamQLiu/b897ee13dcd8ca7116d0bfe1575fc175 to your computer and use it in GitHub Desktop.
Save WilliamQLiu/b897ee13dcd8ca7116d0bfe1575fc175 to your computer and use it in GitHub Desktop.
Sidekiq queue checking via rails console
stats = Sidekiq::Stats.new
stats.queues
stats.enqueued
stats.processed
stats.failed
scheduled_queue = Sidekiq::ScheduledSet.new
retry_queue = Sidekiq::RetrySet.new
default_queue = Sidekiq::Queue.new("default")
default_queue.each do | job |
class_arg = job.args[0].split('-').select { | arg | arg.match(' !ruby/class') }[0]
p class_arg.split[1].gsub '\'', '' unless class_arg.nil?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment