Class: OkComputer::ResqueFailureThresholdCheck
- Inherits:
 - 
      SizeThresholdCheck
      
        
- Object
 - Check
 - SizeThresholdCheck
 - OkComputer::ResqueFailureThresholdCheck
 
 
- Defined in:
 - lib/ok_computer/built_in_checks/resque_failure_threshold_check.rb
 
Constant Summary
Constants inherited from Check
Instance Attribute Summary collapse
- 
  
    
      #threshold  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute threshold.
 
Attributes inherited from SizeThresholdCheck
Attributes inherited from Check
#failure_occurred, #message, #registrant_name
Instance Method Summary collapse
- 
  
    
      #initialize(threshold)  ⇒ ResqueFailureThresholdCheck 
    
    
  
  
  
    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
Constructor Details
#initialize(threshold) ⇒ ResqueFailureThresholdCheck
Public: Initialize a check for a backed-up Resque queue
threshold - An Integer to compare the queue’s count against to consider
it backed up
  
      9 10 11 12  | 
    
      # File 'lib/ok_computer/built_in_checks/resque_failure_threshold_check.rb', line 9 def initialize(threshold) self.threshold = Integer(threshold) self.name = "Resque Failed Jobs" end  | 
  
Instance Attribute Details
#threshold ⇒ Object
Returns the value of attribute threshold.
      3 4 5  | 
    
      # File 'lib/ok_computer/built_in_checks/resque_failure_threshold_check.rb', line 3 def threshold @threshold end  | 
  
Instance Method Details
#size ⇒ Object
Public: The number of jobs in the check’s queue
      15 16 17  | 
    
      # File 'lib/ok_computer/built_in_checks/resque_failure_threshold_check.rb', line 15 def size Resque::Failure.count end  |