Class: Eye::Checker::Cpu
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
#check, 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!
included
Constructor Details
This class inherits a constructor from Eye::Checker
Instance Method Details
#check_name ⇒ Object
7
8
9
|
# File 'lib/eye/checker/cpu.rb', line 7
def check_name
@check_name ||= "cpu(#{human_value(below)})"
end
|
#good?(value) ⇒ Boolean
19
20
21
22
23
24
25
|
# File 'lib/eye/checker/cpu.rb', line 19
def good?(value)
if below
value < below
else
true
end
end
|
#human_value(value) ⇒ Object
15
16
17
|
# File 'lib/eye/checker/cpu.rb', line 15
def human_value(value)
"#{value}%"
end
|