Class: DynoscaleRuby::Worker::Resque
- Inherits:
-
Object
- Object
- DynoscaleRuby::Worker::Resque
- Includes:
- Singleton
- Defined in:
- lib/dynoscale_ruby/worker/resque.rb
Class Method Summary collapse
- .enabled? ⇒ Boolean
- .name ⇒ Object
- .queue_latencies ⇒ Object
- .queues(source = ::Resque.queues) ⇒ Object
Class Method Details
.enabled? ⇒ Boolean
8 9 10 11 12 13 14 15 16 |
# File 'lib/dynoscale_ruby/worker/resque.rb', line 8 def self.enabled? return false if ENV['SKIP_DYNOSCALE_AGENT'] require 'resque' require 'resque_latency' true rescue LoadError false end |
.name ⇒ Object
28 29 30 |
# File 'lib/dynoscale_ruby/worker/resque.rb', line 28 def self.name 'resque' end |
.queue_latencies ⇒ Object
18 19 20 21 22 |
# File 'lib/dynoscale_ruby/worker/resque.rb', line 18 def self.queue_latencies queues.map do |queue| [queue.name, (::Resque.latency(queue)* 1000).ceil, ::Resque.size(queue)] end end |
.queues(source = ::Resque.queues) ⇒ Object
24 25 26 |
# File 'lib/dynoscale_ruby/worker/resque.rb', line 24 def self.queues(source = ::Resque.queues) @@queues ||= source end |