lib/bluepill/condition_watch.rb in bluepill-0.0.60 vs lib/bluepill/condition_watch.rb in bluepill-0.0.61

- old
+ new

@@ -13,20 +13,21 @@ @logger = options.delete(:logger) @fires = options.has_key?(:fires) ? Array(options.delete(:fires)) : [:restart] @every = options.delete(:every) @times = options.delete(:times) || [1,1] @times = [@times, @times] unless @times.is_a?(Array) # handles :times => 5 + @include_children = options.delete(:include_children) || false self.clear_history! @process_condition = ProcessConditions[@name].new(options) end def run(pid, tick_number = Time.now.to_i) if @last_ran_at.nil? || (@last_ran_at + @every) <= tick_number @last_ran_at = tick_number - value = @process_condition.run(pid) + value = @process_condition.run(pid, @include_children) @history << HistoryValue.new(@process_condition.format_value(value), @process_condition.check(value)) self.logger.info(self.to_s) return @fires if self.fired? end