Class: Eye::Checker::Cputime

Inherits:
Eye::Checker show all
Defined in:
lib/eye/checker/cputime.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 Eye::Checker

#check, #check_name, create, #defer, depends_on, get_class, #get_value_safe, #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

#get_valueObject



7
8
9
# File 'lib/eye/checker/cputime.rb', line 7

def get_value
  Eye::SystemResources.cputime(@pid).to_f
end

#good?(value) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
18
19
20
21
# File 'lib/eye/checker/cputime.rb', line 15

def good?(value)
  if below
    value < below
  else
    true
  end
end

#human_value(value) ⇒ Object



11
12
13
# File 'lib/eye/checker/cputime.rb', line 11

def human_value(value)
  "#{value / 60}m"
end