Class: Eye::Checker::Memory
- Inherits:
-
Measure
- Object
- Eye::Checker
- Measure
- Eye::Checker::Memory
- Defined in:
- lib/eye/checker/memory.rb
Constant Summary
Constants inherited from Eye::Checker
Instance Attribute Summary
Attributes inherited from Eye::Checker
#check_count, #options, #pid, #process, #type, #value, #values
Instance Method Summary collapse
-
#check_name ⇒ Object
check :memory, :every => 3.seconds, :below => 80.megabytes, :times => [3,5].
- #get_value ⇒ Object
- #human_value(value) ⇒ Object
Methods inherited from Measure
Methods inherited from Eye::Checker
#check, create, #defer, #fire, get_class, #get_value_safe, #good?, #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
Constructor Details
This class inherits a constructor from Eye::Checker
Instance Method Details
#check_name ⇒ Object
check :memory, :every => 3.seconds, :below => 80.megabytes, :times => [3,5]
5 6 7 |
# File 'lib/eye/checker/memory.rb', line 5 def check_name @check_name ||= "memory(#{measure_str})" end |
#get_value ⇒ Object
9 10 11 |
# File 'lib/eye/checker/memory.rb', line 9 def get_value Eye::SystemResources.memory(@pid).to_i end |
#human_value(value) ⇒ Object
13 14 15 |
# File 'lib/eye/checker/memory.rb', line 13 def human_value(value) "#{value.to_i / 1024 / 1024}Mb" end |