Class: Sideq::Stats
- Inherits:
-
Object
- Object
- Sideq::Stats
- Defined in:
- lib/sideq/stats.rb
Instance Attribute Summary collapse
-
#dead_set ⇒ Object
readonly
Returns the value of attribute dead_set.
-
#retry_set ⇒ Object
readonly
Returns the value of attribute retry_set.
-
#stats ⇒ Object
readonly
Returns the value of attribute stats.
Instance Method Summary collapse
-
#initialize ⇒ Stats
constructor
A new instance of Stats.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Stats
Returns a new instance of Stats.
5 6 7 8 9 |
# File 'lib/sideq/stats.rb', line 5 def initialize @stats = Sidekiq::Stats.new @retry_set = Sidekiq::RetrySet.new @dead_set = Sidekiq::DeadSet.new end |
Instance Attribute Details
#dead_set ⇒ Object (readonly)
Returns the value of attribute dead_set.
3 4 5 |
# File 'lib/sideq/stats.rb', line 3 def dead_set @dead_set end |
#retry_set ⇒ Object (readonly)
Returns the value of attribute retry_set.
3 4 5 |
# File 'lib/sideq/stats.rb', line 3 def retry_set @retry_set end |
#stats ⇒ Object (readonly)
Returns the value of attribute stats.
3 4 5 |
# File 'lib/sideq/stats.rb', line 3 def stats @stats end |
Instance Method Details
#to_s ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/sideq/stats.rb', line 11 def to_s stat_ary = [ "Processed: #{stats.processed}", "Failed: #{stats.failed}", "Scheduled size: #{stats.scheduled_size}", "Retry size: #{stats.retry_size}", "Dead size: #{stats.dead_size}", "Enqueued: #{stats.enqueued}", "Processes: #{stats.processes_size}", "Workers: #{stats.workers_size}", "Default queue latency: #{stats.default_queue_latency}", "Queues: dead: #{dead_set.size}", " retry: #{retry_set.size}" ] stats.queues.each do |(queue_name, queue_size)| stat_ary << " #{queue_name}: #{queue_size}" end stat_ary.join( "\n" ) end |