Class: SolidQueueGuard::Configuration
- Inherits:
-
Object
- Object
- SolidQueueGuard::Configuration
- Defined in:
- lib/solid_queue_guard/configuration.rb
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#failed_jobs_threshold ⇒ Object
Returns the value of attribute failed_jobs_threshold.
-
#health_cache_ttl ⇒ Object
Returns the value of attribute health_cache_ttl.
-
#health_token ⇒ Object
Returns the value of attribute health_token.
-
#integrate_rails_health ⇒ Object
Returns the value of attribute integrate_rails_health.
-
#metrics_backends ⇒ Object
Returns the value of attribute metrics_backends.
-
#notify_with ⇒ Object
Returns the value of attribute notify_with.
-
#queue_lag_thresholds ⇒ Object
Returns the value of attribute queue_lag_thresholds.
-
#scheduled_backlog_threshold ⇒ Object
Returns the value of attribute scheduled_backlog_threshold.
-
#stale_process_threshold ⇒ Object
Returns the value of attribute stale_process_threshold.
-
#strict_mode ⇒ Object
Returns the value of attribute strict_mode.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #strict? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/solid_queue_guard/configuration.rb', line 17 def initialize @enabled = true @queue_lag_thresholds = { default: 5.minutes } @failed_jobs_threshold = 20 @stale_process_threshold = 5.minutes @health_token = nil @strict_mode = false @health_cache_ttl = 15.seconds @scheduled_backlog_threshold = 100 @integrate_rails_health = false @notify_with = [:rails_logger] @metrics_backends = [] end |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
5 6 7 |
# File 'lib/solid_queue_guard/configuration.rb', line 5 def enabled @enabled end |
#failed_jobs_threshold ⇒ Object
Returns the value of attribute failed_jobs_threshold.
5 6 7 |
# File 'lib/solid_queue_guard/configuration.rb', line 5 def failed_jobs_threshold @failed_jobs_threshold end |
#health_cache_ttl ⇒ Object
Returns the value of attribute health_cache_ttl.
5 6 7 |
# File 'lib/solid_queue_guard/configuration.rb', line 5 def health_cache_ttl @health_cache_ttl end |
#health_token ⇒ Object
Returns the value of attribute health_token.
5 6 7 |
# File 'lib/solid_queue_guard/configuration.rb', line 5 def health_token @health_token end |
#integrate_rails_health ⇒ Object
Returns the value of attribute integrate_rails_health.
5 6 7 |
# File 'lib/solid_queue_guard/configuration.rb', line 5 def integrate_rails_health @integrate_rails_health end |
#metrics_backends ⇒ Object
Returns the value of attribute metrics_backends.
5 6 7 |
# File 'lib/solid_queue_guard/configuration.rb', line 5 def metrics_backends @metrics_backends end |
#notify_with ⇒ Object
Returns the value of attribute notify_with.
5 6 7 |
# File 'lib/solid_queue_guard/configuration.rb', line 5 def notify_with @notify_with end |
#queue_lag_thresholds ⇒ Object
Returns the value of attribute queue_lag_thresholds.
5 6 7 |
# File 'lib/solid_queue_guard/configuration.rb', line 5 def queue_lag_thresholds @queue_lag_thresholds end |
#scheduled_backlog_threshold ⇒ Object
Returns the value of attribute scheduled_backlog_threshold.
5 6 7 |
# File 'lib/solid_queue_guard/configuration.rb', line 5 def scheduled_backlog_threshold @scheduled_backlog_threshold end |
#stale_process_threshold ⇒ Object
Returns the value of attribute stale_process_threshold.
5 6 7 |
# File 'lib/solid_queue_guard/configuration.rb', line 5 def stale_process_threshold @stale_process_threshold end |
#strict_mode ⇒ Object
Returns the value of attribute strict_mode.
5 6 7 |
# File 'lib/solid_queue_guard/configuration.rb', line 5 def strict_mode @strict_mode end |
Instance Method Details
#strict? ⇒ Boolean
31 32 33 |
# File 'lib/solid_queue_guard/configuration.rb', line 31 def strict? strict_mode || ActiveModel::Type::Boolean.new.cast(ENV.fetch('SOLID_QUEUE_GUARD_STRICT', nil)) end |