Class: ResqueToCloudwatch::WorkersAliveCollector
- Inherits:
-
Object
- Object
- ResqueToCloudwatch::WorkersAliveCollector
- Defined in:
- lib/resque_to_cloudwatch/collectors.rb
Instance Method Summary collapse
- #get_value ⇒ Object
-
#initialize(config) ⇒ WorkersAliveCollector
constructor
A new instance of WorkersAliveCollector.
- #metric_name ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(config) ⇒ WorkersAliveCollector
Returns a new instance of WorkersAliveCollector.
50 51 52 |
# File 'lib/resque_to_cloudwatch/collectors.rb', line 50 def initialize(config) @config = config end |
Instance Method Details
#get_value ⇒ Object
54 55 56 57 |
# File 'lib/resque_to_cloudwatch/collectors.rb', line 54 def get_value redis = Redis.new(:host => @config.redis_host, :port => @config.redis_port) redis.smembers('resque:workers').length end |
#metric_name ⇒ Object
59 60 61 |
# File 'lib/resque_to_cloudwatch/collectors.rb', line 59 def metric_name "resque_workers_alive" end |
#to_s ⇒ Object
63 64 65 |
# File 'lib/resque_to_cloudwatch/collectors.rb', line 63 def to_s metric_name end |