Mind Dump, Tech And Life Blog
written by Ivan Alenko
published under license bootleg
posted in category Copied Stuff / Tech
posted at 28. Jun '20

Sidekiq Statistics From Console

Source: https://gist.github.com/ngsmrk/4ad439143622a46b8a5b

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

Add Comment