Search code examples
ruby-on-railsherokusidekiq

Is stats.queues method removed in Sidekiq 3.3.1? How to fetch queues now?


I just upgraded to Rails 4.1.9 and Sidekiq 3.3.1 (running on Heroku).

I've been using the Sidekiq API and based on the documentation https://github.com/mperham/sidekiq/wiki/API the stats.queues method should still be there, but in practice it doesn't seem to be:

irb(main):001:0> stats = Sidekiq::Stats.new
=> #<Sidekiq::Stats:0x007f73db350290 @stats={:processed=>464, :failed=>3, :scheduled_size=>2, :retry_size=>0, :dead_size=>2, :processes_size=>1, :default_queue_latency=>0, :workers_size=>0, :enqueued=>0}>

irb(main):002:0> stats.queues
NoMethodError: undefined method `queues' for #<Sidekiq::Stats:0x007f73db350290>

irb(main):006:0> Sidekiq::Stats.new.methods - Object.methods
=> [:processed, :failed, :scheduled_size, :retry_size, :dead_size, :enqueued, :processes_size, :workers_size, :default_queue_latency, :fetch_stats!, :reset]

Is it deprecated and the docs are outdated? Or could this be an environment problem?

Is there a way to list the queues in Sidekiq 3.3.1?


Solution

  • They remove queues method from stats by mistake, pr here

    You can use Sidekiq::Stats::Queues.new.lengths now, and old behavior after new release