Module: Eye::Process::Trigger

Included in:
Eye::Process
Defined in:
lib/eye/process/trigger.rb

Instance Method Summary collapse

Instance Method Details

#add_triggersObject



3
4
5
6
7
8
9
# File 'lib/eye/process/trigger.rb', line 3

def add_triggers
  if self[:triggers]
    self[:triggers].each do |type, cfg|
      add_trigger(cfg)
    end
  end
end

#check_triggers(transition) ⇒ Object



15
16
17
# File 'lib/eye/process/trigger.rb', line 15

def check_triggers(transition)
  self.triggers.each { |trigger| trigger.notify(transition, state_reason) }
end

#remove_triggersObject



11
12
13
# File 'lib/eye/process/trigger.rb', line 11

def remove_triggers
  self.triggers = []
end

#retry_start_after_flappingObject



19
20
21
22
23
24
25
# File 'lib/eye/process/trigger.rb', line 19

def retry_start_after_flapping
  return unless unmonitored?
  return unless state_reason.to_s.include?('flapping') # TODO: remove hackety

  schedule :start, Eye::Reason.new(:'retry start after flapping')
  self.flapping_times += 1
end