How to see statistics about workers in Saidkik?

We can get some sidekiq status information through its API . There is no API method for workers.

I want to know how many workers are working on a particular class. For example, I have a class called FooStreamer.rb and it is executed using the perform_async method. I want to know how many workers it is currently working.

Any ideas?

+4
source share
3 answers

Solved by Mike (creator of sidekiq) with the following commit:

https://github.com/mperham/sidekiq/commit/c606dd4fde8cdc795d2c750d211a74bf1b380217

+4
source

Sidekiq comes with a Sinatra web interface that can be accessed through mydomain.com/sidekiq. You just need to install it according to these instructions (it differs depending on whether you use Passenger or Unicorn)

https://github.com/mperham/sidekiq/wiki/Monitoring

There is no API I know about, but you can easily iterate over Redis keys that store Sidekiq information to count the number of workers working in a particular queue

 workers = redis.smembers("workers") workers.each do |worker| tokens = worker.split(":") machine = tokens[0] pid = tokens[1].split("-")[0] key = "worker:" + pid obj = redis.get(key) #obj will contain information on what queue this worker is processing end 
+1
source

You can use https://github.com/phstc/sidekiq-statsd and check the statistics with graphite.

0
source

All Articles