Created
September 3, 2013 13:02
-
-
Save blasterpal/6423606 to your computer and use it in GitHub Desktop.
Basic Sidekiq queue info mixin.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Sidekiq | |
| class Info | |
| class << self | |
| def queue_names | |
| Sidekiq.redis {|conn| | |
| conn.smembers('queues').sort | |
| } | |
| end | |
| def queue_counts | |
| queue_status = {} | |
| queue_names.each do |queue| | |
| Sidekiq.redis {|conn| | |
| queue_status["#{queue}"] = conn.llen "queue:#{queue}" | |
| } | |
| end | |
| {"sidekiq queue sizes " => queue_status} | |
| end | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment