Class: Sidekiq::Stats
- Inherits:
-
Object
- Object
- Sidekiq::Stats
- Defined in:
- lib/sidekiq/api.rb
Overview
Defined Under Namespace
Classes: History
Instance Method Summary collapse
- #dead_size ⇒ Object
- #default_queue_latency ⇒ Object
- #enqueued ⇒ Object
- #failed ⇒ Object
-
#initialize ⇒ Stats
constructor
A new instance of Stats.
- #processed ⇒ Object
- #processes_size ⇒ Object
- #queues ⇒ Object
- #retry_size ⇒ Object
- #scheduled_size ⇒ Object
- #workers_size ⇒ Object
Constructor Details
#initialize ⇒ Stats
Returns a new instance of Stats.
28 29 30 |
# File 'lib/sidekiq/api.rb', line 28 def initialize fetch_stats_fast! end |
Instance Method Details
#dead_size ⇒ Object
48 49 50 |
# File 'lib/sidekiq/api.rb', line 48 def dead_size stat :dead_size end |
#default_queue_latency ⇒ Object
64 65 66 |
# File 'lib/sidekiq/api.rb', line 64 def default_queue_latency stat :default_queue_latency end |
#enqueued ⇒ Object
52 53 54 |
# File 'lib/sidekiq/api.rb', line 52 def enqueued stat :enqueued end |
#failed ⇒ Object
36 37 38 |
# File 'lib/sidekiq/api.rb', line 36 def failed stat :failed end |
#processed ⇒ Object
32 33 34 |
# File 'lib/sidekiq/api.rb', line 32 def processed stat :processed end |
#processes_size ⇒ Object
56 57 58 |
# File 'lib/sidekiq/api.rb', line 56 def processes_size stat :processes_size end |
#queues ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/sidekiq/api.rb', line 68 def queues Sidekiq.redis do |conn| queues = conn.sscan("queues").to_a lengths = conn.pipelined { |pipeline| queues.each do |queue| pipeline.llen("queue:#{queue}") end } array_of_arrays = queues.zip(lengths).sort_by { |_, size| -size } array_of_arrays.to_h end end |
#retry_size ⇒ Object
44 45 46 |
# File 'lib/sidekiq/api.rb', line 44 def retry_size stat :retry_size end |
#scheduled_size ⇒ Object
40 41 42 |
# File 'lib/sidekiq/api.rb', line 40 def scheduled_size stat :scheduled_size end |
#workers_size ⇒ Object
60 61 62 |
# File 'lib/sidekiq/api.rb', line 60 def workers_size stat :workers_size end |