Class: Eye::Checker::ChildrenCount

Inherits:
Measure show all
Defined in:
lib/eye/checker/children_count.rb

Constant Summary

Constants inherited from Eye::Checker

TYPES

Instance Attribute Summary

Attributes inherited from Eye::Checker

#check_count, #options, #pid, #process, #type, #value, #values

Instance Method Summary collapse

Methods inherited from Measure

#good?, #measure_str

Methods inherited from Eye::Checker

#check, #check_name, create, #defer, get_class, #get_value_safe, #good?, #human_value, #initialize, #inspect, #last_human_values, #logger_sub_tag, #logger_tag, #max_tries, #min_tries, name_and_class, #previous_value, register, requires, #run_in_process_context, validate!

Methods included from Dsl::Validation

included

Constructor Details

This class inherits a constructor from Eye::Checker

Instance Method Details

#fireObject


12
13
14
15
16
17
18
19
20
# File 'lib/eye/checker/children_count.rb', line 12

def fire
  if strategy == :restart
    super
  else
    pids = ordered_by_date_children_pids
    pids = (strategy == :kill_old) ? pids[0...-below] : pids[below..-1]
    kill_pids(pids)
  end
end

#get_valueObject


8
9
10
# File 'lib/eye/checker/children_count.rb', line 8

def get_value
  process.children.size
end