Class: Monitors::ResponseTime

Inherits:
Base
  • Object
show all
Defined in:
lib/monitors/response_time.rb

Class Method Summary collapse

Methods inherited from Base

run

Methods included from Logging

#log, #logger

Class Method Details

.check_intervalObject



21
22
23
# File 'lib/monitors/response_time.rb', line 21

def check_interval
  Cfg.response_time_check_interval
end

.perform_checkObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/monitors/response_time.rb', line 8

def perform_check
  all_processes_ok = true
  running_instances.each do |p|
    if ViolationsRecorders::ResponseTime.is_violating?(p)
      all_processes_ok = false
      log "process #{p} had a response time violation"
      Phantom::Manager.restart(p)
    end
  end

  log "All response time are ok" if all_processes_ok
end