2

I'd like to count from the Rails console the total number of available Sidekiq threads/processors.

threads != workers

Sidekiq::Workers.size doesn't work
Jean Meyer
  • 409
  • 1
  • 3
  • 12
  • this other answer may help you http://stackoverflow.com/questions/12683222/are-there-console-commands-to-look-at-whats-in-the-queue-and-to-clear-the-queue – neydroid Jul 19 '16 at 22:48

1 Answers1

4

You are looking for Sidekiq::ProcessSet#each.

https://github.com/mperham/sidekiq/blob/master/lib/sidekiq/api.rb#L719

Sidekiq::ProcessSet.new.each do |pro| 
  puts "I have #{pro['concurrency'] - pro['busy']} threads free"
end
Mike Perham
  • 21,300
  • 6
  • 59
  • 61