Sidekiq: Count the number of available threads
我想从Rails控制台中计算可用的Sidekiq线程/处理器的总数。
1 | Sidekiq::Workers.size doesn't work |
您正在寻找
https://github.com/mperham/sidekiq/blob/master/lib/sidekiq/api.rb#L719
1 2 3 | Sidekiq::ProcessSet.new.each do |pro| puts"I have #{pro['concurrency'] - pro['busy']} threads free" end |