Module: Katalyst::Healthcheck::Monitored::ClassMethods
- Defined in:
- lib/katalyst/healthcheck/monitored.rb
Instance Method Summary collapse
-
#define_healthcheck_task(name, description, interval:) ⇒ Object
(also: #define_task)
Define a task to be monitored.
-
#defined_healthcheck_tasks ⇒ Hash
Defined tasks keyed by name.
-
#healthy!(name) ⇒ Object
Mark a task as healthy.
-
#unhealthy!(name, error = nil) ⇒ Object
Mark a task as unhealthy.
Instance Method Details
#define_healthcheck_task(name, description, interval:) ⇒ Object Also known as: define_task
Define a task to be monitored
15 16 17 |
# File 'lib/katalyst/healthcheck/monitored.rb', line 15 def define_healthcheck_task(name, description, interval:) defined_healthcheck_tasks[name] = Task.new(name: name, description: description, interval: interval) end |
#defined_healthcheck_tasks ⇒ Hash
Returns Defined tasks keyed by name.
21 22 23 |
# File 'lib/katalyst/healthcheck/monitored.rb', line 21 def defined_healthcheck_tasks @defined_healthcheck_tasks ||= {} end |
#healthy!(name) ⇒ Object
Mark a task as healthy
27 28 29 |
# File 'lib/katalyst/healthcheck/monitored.rb', line 27 def healthy!(name) find_or_create_task(name).healthy! end |
#unhealthy!(name, error = nil) ⇒ Object
Mark a task as unhealthy
34 35 36 |
# File 'lib/katalyst/healthcheck/monitored.rb', line 34 def unhealthy!(name, error = nil) find_or_create_task(name).unhealthy!(error) end |