Class: Murakumo::HealthCheckNotifier

Inherits:
Object
  • Object
show all
Defined in:
lib/srv/murakumo_health_check_notifier.rb

Instance Method Summary collapse

Constructor Details

#initialize(address, name, logger, options) ⇒ HealthCheckNotifier

Returns a new instance of HealthCheckNotifier.



9
10
11
12
13
14
15
16
17
18
# File 'lib/srv/murakumo_health_check_notifier.rb', line 9

def initialize(address, name, logger, options)
  @address = address
  @name = name
  @logger = logger
  @args = options[:args]
  @sender = options[:sender]
  @recipients = options[:recipients]
  @open_timeout = options[:open_timeout]
  @read_timeout = options[:read_timeout]
end

Instance Method Details

#notify_activeObject



20
21
22
# File 'lib/srv/murakumo_health_check_notifier.rb', line 20

def notify_active
  notify('healthy', "#{@name} became healthy :-)")
end

#notify_inactiveObject



24
25
26
# File 'lib/srv/murakumo_health_check_notifier.rb', line 24

def notify_inactive
  notify('unhealthy', "#{@name} became unhealthy :-(")
end