Class: Eye::Checker::Measure

Inherits:
Eye::Checker show all
Defined in:
lib/eye/checker.rb

Direct Known Subclasses

Cpu, Cputime, FileSize, Memory, Runtime

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 Eye::Checker

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

Methods included from Dsl::Validation

included

Constructor Details

This class inherits a constructor from Eye::Checker

Instance Method Details

#good?(value) ⇒ Boolean

Returns:

  • (Boolean)


228
229
230
231
232
# File 'lib/eye/checker.rb', line 228

def good?(value)
  return false if below && (value > below)
  return false if above && (value < above)
  true
end

#measure_strObject



234
235
236
237
238
239
240
241
242
243
244
# File 'lib/eye/checker.rb', line 234

def measure_str
  if below && above
    ">#{human_value(above)}<#{human_value(below)}"
  elsif below
    "<#{human_value(below)}"
  elsif above
    ">#{human_value(above)}"
  else
    '-'
  end
end