Class: OkComputer::ResqueBackedUpCheck
- Inherits:
-
SizeThresholdCheck
- Object
- Check
- SizeThresholdCheck
- OkComputer::ResqueBackedUpCheck
- Defined in:
- lib/ok_computer/built_in_checks/resque_backed_up_check.rb
Constant Summary
Constants inherited from Check
Instance Attribute Summary collapse
-
#queue ⇒ Object
Returns the value of attribute queue.
-
#threshold ⇒ Object
Returns the value of attribute threshold.
Attributes inherited from SizeThresholdCheck
Attributes inherited from Check
#failure_occurred, #message, #registrant_name, #time
Instance Method Summary collapse
-
#initialize(queue, threshold) ⇒ ResqueBackedUpCheck
constructor
Public: Initialize a check for a backed-up Resque queue.
-
#size ⇒ Object
Public: The number of jobs in the check’s queue.
Methods inherited from SizeThresholdCheck
Methods inherited from Check
#<=>, #clear, #mark_failure, #mark_message, #run, #success?, #to_json, #to_text, #with_benchmarking
Constructor Details
#initialize(queue, threshold) ⇒ ResqueBackedUpCheck
Public: Initialize a check for a backed-up Resque queue
queue - The name of the Resque queue to check threshold - An Integer to compare the queue’s count against to consider
it backed up
11 12 13 14 15 |
# File 'lib/ok_computer/built_in_checks/resque_backed_up_check.rb', line 11 def initialize(queue, threshold) self.queue = queue self.threshold = Integer(threshold) self.name = "Resque queue '#{queue}'" end |
Instance Attribute Details
#queue ⇒ Object
Returns the value of attribute queue.
3 4 5 |
# File 'lib/ok_computer/built_in_checks/resque_backed_up_check.rb', line 3 def queue @queue end |
#threshold ⇒ Object
Returns the value of attribute threshold.
4 5 6 |
# File 'lib/ok_computer/built_in_checks/resque_backed_up_check.rb', line 4 def threshold @threshold end |
Instance Method Details
#size ⇒ Object
Public: The number of jobs in the check’s queue
18 19 20 |
# File 'lib/ok_computer/built_in_checks/resque_backed_up_check.rb', line 18 def size Resque.size(queue) end |