Class: HealthMonitor::Providers::Sidekiq::Configuration
- Inherits:
-
Base::Configuration
- Object
- Base::Configuration
- HealthMonitor::Providers::Sidekiq::Configuration
- Defined in:
- lib/health_monitor/providers/sidekiq.rb
Constant Summary collapse
- DEFAULT_QUEUE_NAME =
'default'
- DEFAULT_LATENCY_TIMEOUT =
30
- DEFAULT_QUEUES_SIZE =
100
- DEFAULT_RETRY_CHECK =
20
Instance Attribute Summary collapse
-
#queues ⇒ Object
readonly
Returns the value of attribute queues.
Attributes inherited from Base::Configuration
Instance Method Summary collapse
- #add_queue_configuration(queue_name, latency: DEFAULT_LATENCY_TIMEOUT, queue_size: DEFAULT_QUEUES_SIZE) ⇒ Object
- #default_queue ⇒ Object
-
#initialize(provider) ⇒ Configuration
constructor
A new instance of Configuration.
- #latency ⇒ Object
- #latency=(value) ⇒ Object
- #queue_size ⇒ Object
- #queue_size=(value) ⇒ Object
Constructor Details
#initialize(provider) ⇒ Configuration
Returns a new instance of Configuration.
19 20 21 22 23 24 |
# File 'lib/health_monitor/providers/sidekiq.rb', line 19 def initialize(provider) super(provider) @queues = {} @queues[DEFAULT_QUEUE_NAME] = { latency: DEFAULT_LATENCY_TIMEOUT, queue_size: DEFAULT_QUEUES_SIZE } end |
Instance Attribute Details
#queues ⇒ Object (readonly)
Returns the value of attribute queues.
17 18 19 |
# File 'lib/health_monitor/providers/sidekiq.rb', line 17 def queues @queues end |
Instance Method Details
#add_queue_configuration(queue_name, latency: DEFAULT_LATENCY_TIMEOUT, queue_size: DEFAULT_QUEUES_SIZE) ⇒ Object
46 47 48 49 50 |
# File 'lib/health_monitor/providers/sidekiq.rb', line 46 def add_queue_configuration(queue_name, latency: DEFAULT_LATENCY_TIMEOUT, queue_size: DEFAULT_QUEUES_SIZE) raise SidekiqException.new('Queue name is mandatory') if queue_name.blank? queues[queue_name] = { latency: latency, queue_size: queue_size } end |
#default_queue ⇒ Object
42 43 44 |
# File 'lib/health_monitor/providers/sidekiq.rb', line 42 def default_queue queues[DEFAULT_QUEUE_NAME] end |
#latency ⇒ Object
30 31 32 |
# File 'lib/health_monitor/providers/sidekiq.rb', line 30 def latency default_queue[:latency] end |
#latency=(value) ⇒ Object
26 27 28 |
# File 'lib/health_monitor/providers/sidekiq.rb', line 26 def latency=(value) default_queue[:latency] = value end |
#queue_size ⇒ Object
38 39 40 |
# File 'lib/health_monitor/providers/sidekiq.rb', line 38 def queue_size default_queue[:queue_size] end |
#queue_size=(value) ⇒ Object
34 35 36 |
# File 'lib/health_monitor/providers/sidekiq.rb', line 34 def queue_size=(value) default_queue[:queue_size] = value end |