Reputation: 409
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
Upvotes: 2
Views: 1814
Reputation: 22208
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
Upvotes: 4