Class: Glimpse::Views::Resque
- Inherits:
-
View
- Object
- View
- Glimpse::Views::Resque
- Defined in:
- lib/glimpse/views/resque.rb
Instance Method Summary collapse
- #context ⇒ Object
-
#initialize(options = {}) ⇒ Resque
constructor
A new instance of Resque.
- #job_count ⇒ Object
- #results ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Resque
Returns a new instance of Resque.
6 7 8 |
# File 'lib/glimpse/views/resque.rb', line 6 def initialize( = {}) @queues = .fetch(:queues, ['*']) end |
Instance Method Details
#context ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/glimpse/views/resque.rb', line 14 def context { :jobs => { :failures => ::Resque::Failure.count } } end |
#job_count ⇒ Object
10 11 12 |
# File 'lib/glimpse/views/resque.rb', line 10 def job_count @queues.collect { |queue| ::Resque.size(queue) }.inject(&:+) end |
#results ⇒ Object
22 23 24 |
# File 'lib/glimpse/views/resque.rb', line 22 def results { :jobs => job_count, :workers => ::Resque.workers.size } end |