Class: OkComputer::SolidQueueFailedJobsCheck
- Inherits:
-
SizeThresholdCheck
- Object
- Check
- SizeThresholdCheck
- OkComputer::SolidQueueFailedJobsCheck
- Defined in:
- lib/ok_computer/built_in_checks/solid_queue_failed_jobs_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, #skip_all, #time
Instance Method Summary collapse
-
#initialize(threshold) ⇒ SolidQueueFailedJobsCheck
constructor
Public: Initialize a check for the total number of failed SolidQueue jobs.
-
#size ⇒ Object
Public: The total number of failed jobs.
Methods inherited from SizeThresholdCheck
Methods inherited from Check
#<=>, #clear, #mark_failure, #mark_message, #run, #success?, #to_json, #to_text, #with_benchmarking
Constructor Details
#initialize(threshold) ⇒ SolidQueueFailedJobsCheck
Public: Initialize a check for the total number of failed SolidQueue jobs
threshold - An Integer to compare the failed job count against to consider it over threshold
9 10 11 12 |
# File 'lib/ok_computer/built_in_checks/solid_queue_failed_jobs_check.rb', line 9 def initialize(threshold) self.threshold = Integer(threshold) self.name = "SolidQueue Failed Jobs" end |
Instance Attribute Details
#threshold ⇒ Object
Returns the value of attribute threshold.
3 4 5 |
# File 'lib/ok_computer/built_in_checks/solid_queue_failed_jobs_check.rb', line 3 def threshold @threshold end |
Instance Method Details
#size ⇒ Object
Public: The total number of failed jobs
15 16 17 |
# File 'lib/ok_computer/built_in_checks/solid_queue_failed_jobs_check.rb', line 15 def size SolidQueue::FailedExecution.count end |