Class: Vmstator::EventCounterStatistics
- Inherits:
-
Object
- Object
- Vmstator::EventCounterStatistics
- Defined in:
- lib/vmstator/linux/event_counter_statistics.rb
Instance Attribute Summary collapse
-
#active_memory ⇒ Object
readonly
Returns the value of attribute active_memory.
-
#boot_time ⇒ Object
readonly
Returns the value of attribute boot_time.
-
#buffer_memory ⇒ Object
readonly
Returns the value of attribute buffer_memory.
-
#cpu_context_switches ⇒ Object
readonly
Returns the value of attribute cpu_context_switches.
-
#forks ⇒ Object
readonly
Returns the value of attribute forks.
-
#free_memory ⇒ Object
readonly
Returns the value of attribute free_memory.
-
#free_swap ⇒ Object
readonly
Returns the value of attribute free_swap.
-
#idle_cpu_ticks ⇒ Object
readonly
Returns the value of attribute idle_cpu_ticks.
-
#inactive_memory ⇒ Object
readonly
Returns the value of attribute inactive_memory.
-
#interrupts ⇒ Object
readonly
Returns the value of attribute interrupts.
-
#io_wait_cpu_ticks ⇒ Object
readonly
Returns the value of attribute io_wait_cpu_ticks.
-
#irq_cpu_ticks ⇒ Object
readonly
Returns the value of attribute irq_cpu_ticks.
-
#nice_user_cpu_ticks ⇒ Object
readonly
Returns the value of attribute nice_user_cpu_ticks.
-
#non_nice_user_cpu_ticks ⇒ Object
readonly
Returns the value of attribute non_nice_user_cpu_ticks.
-
#pages_paged_in ⇒ Object
readonly
Returns the value of attribute pages_paged_in.
-
#pages_paged_out ⇒ Object
readonly
Returns the value of attribute pages_paged_out.
-
#pages_swapped_in ⇒ Object
readonly
Returns the value of attribute pages_swapped_in.
-
#pages_swapped_out ⇒ Object
readonly
Returns the value of attribute pages_swapped_out.
-
#softirq_cpu_ticks ⇒ Object
readonly
Returns the value of attribute softirq_cpu_ticks.
-
#stolen_cpu_ticks ⇒ Object
readonly
Returns the value of attribute stolen_cpu_ticks.
-
#swap_cache ⇒ Object
readonly
Returns the value of attribute swap_cache.
-
#system_cpu_ticks ⇒ Object
readonly
Returns the value of attribute system_cpu_ticks.
-
#total_memory ⇒ Object
readonly
Returns the value of attribute total_memory.
-
#total_swap ⇒ Object
readonly
Returns the value of attribute total_swap.
-
#used_memory ⇒ Object
readonly
Returns the value of attribute used_memory.
-
#used_swap ⇒ Object
readonly
Returns the value of attribute used_swap.
Instance Method Summary collapse
-
#initialize(data = false) ⇒ EventCounterStatistics
constructor
A new instance of EventCounterStatistics.
- #update(data) ⇒ Object
Constructor Details
#initialize(data = false) ⇒ EventCounterStatistics
Returns a new instance of EventCounterStatistics.
31 32 33 34 35 36 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 31 def initialize(data=false) if data update(data) end true end |
Instance Attribute Details
#active_memory ⇒ Object (readonly)
Returns the value of attribute active_memory.
6 7 8 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 6 def active_memory @active_memory end |
#boot_time ⇒ Object (readonly)
Returns the value of attribute boot_time.
28 29 30 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 28 def boot_time @boot_time end |
#buffer_memory ⇒ Object (readonly)
Returns the value of attribute buffer_memory.
9 10 11 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 9 def buffer_memory @buffer_memory end |
#cpu_context_switches ⇒ Object (readonly)
Returns the value of attribute cpu_context_switches.
27 28 29 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 27 def cpu_context_switches @cpu_context_switches end |
#forks ⇒ Object (readonly)
Returns the value of attribute forks.
29 30 31 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 29 def forks @forks end |
#free_memory ⇒ Object (readonly)
Returns the value of attribute free_memory.
8 9 10 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 8 def free_memory @free_memory end |
#free_swap ⇒ Object (readonly)
Returns the value of attribute free_swap.
13 14 15 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 13 def free_swap @free_swap end |
#idle_cpu_ticks ⇒ Object (readonly)
Returns the value of attribute idle_cpu_ticks.
17 18 19 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 17 def idle_cpu_ticks @idle_cpu_ticks end |
#inactive_memory ⇒ Object (readonly)
Returns the value of attribute inactive_memory.
7 8 9 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 7 def inactive_memory @inactive_memory end |
#interrupts ⇒ Object (readonly)
Returns the value of attribute interrupts.
26 27 28 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 26 def interrupts @interrupts end |
#io_wait_cpu_ticks ⇒ Object (readonly)
Returns the value of attribute io_wait_cpu_ticks.
18 19 20 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 18 def io_wait_cpu_ticks @io_wait_cpu_ticks end |
#irq_cpu_ticks ⇒ Object (readonly)
Returns the value of attribute irq_cpu_ticks.
19 20 21 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 19 def irq_cpu_ticks @irq_cpu_ticks end |
#nice_user_cpu_ticks ⇒ Object (readonly)
Returns the value of attribute nice_user_cpu_ticks.
15 16 17 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 15 def nice_user_cpu_ticks @nice_user_cpu_ticks end |
#non_nice_user_cpu_ticks ⇒ Object (readonly)
Returns the value of attribute non_nice_user_cpu_ticks.
14 15 16 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 14 def non_nice_user_cpu_ticks @non_nice_user_cpu_ticks end |
#pages_paged_in ⇒ Object (readonly)
Returns the value of attribute pages_paged_in.
22 23 24 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 22 def pages_paged_in @pages_paged_in end |
#pages_paged_out ⇒ Object (readonly)
Returns the value of attribute pages_paged_out.
23 24 25 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 23 def pages_paged_out @pages_paged_out end |
#pages_swapped_in ⇒ Object (readonly)
Returns the value of attribute pages_swapped_in.
24 25 26 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 24 def pages_swapped_in @pages_swapped_in end |
#pages_swapped_out ⇒ Object (readonly)
Returns the value of attribute pages_swapped_out.
25 26 27 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 25 def pages_swapped_out @pages_swapped_out end |
#softirq_cpu_ticks ⇒ Object (readonly)
Returns the value of attribute softirq_cpu_ticks.
20 21 22 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 20 def softirq_cpu_ticks @softirq_cpu_ticks end |
#stolen_cpu_ticks ⇒ Object (readonly)
Returns the value of attribute stolen_cpu_ticks.
21 22 23 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 21 def stolen_cpu_ticks @stolen_cpu_ticks end |
#swap_cache ⇒ Object (readonly)
Returns the value of attribute swap_cache.
10 11 12 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 10 def swap_cache @swap_cache end |
#system_cpu_ticks ⇒ Object (readonly)
Returns the value of attribute system_cpu_ticks.
16 17 18 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 16 def system_cpu_ticks @system_cpu_ticks end |
#total_memory ⇒ Object (readonly)
Returns the value of attribute total_memory.
4 5 6 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 4 def total_memory @total_memory end |
#total_swap ⇒ Object (readonly)
Returns the value of attribute total_swap.
11 12 13 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 11 def total_swap @total_swap end |
#used_memory ⇒ Object (readonly)
Returns the value of attribute used_memory.
5 6 7 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 5 def used_memory @used_memory end |
#used_swap ⇒ Object (readonly)
Returns the value of attribute used_swap.
12 13 14 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 12 def used_swap @used_swap end |
Instance Method Details
#update(data) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/vmstator/linux/event_counter_statistics.rb', line 38 def update(data) if data @total_memory = data[:total_memory] @used_memory = data[:used_memory] @active_memory = data[:active_memory] @inactive_memory = data[:inactive_memory] @free_memory = data[:free_memory] @buffer_memory = data[:buffer_memory] @swap_cache = data[:swap_cache] @total_swap = data[:total_swap] @used_swap = data[:used_swap] @free_swap = data[:free_swap] @non_nice_user_cpu_ticks = data[:non_nice_user_cpu_ticks] @nice_user_cpu_ticks = data[:nice_user_cpu_ticks] @system_cpu_ticks = data[:system_cpu_ticks] @idle_cpu_ticks = data[:idle_cpu_ticks] @io_wait_cpu_ticks = data[:io_wait_cpu_ticks] @irq_cpu_ticks = data[:irq_cpu_ticks] @softirq_cpu_ticks = data[:softirq_cpu_ticks] @stolen_cpu_ticks = data[:stolen_cpu_ticks] @pages_paged_in = data[:pages_paged_in] @pages_paged_out = data[:pages_paged_out] @pages_swapped_in = data[:pages_swapped_in] @pages_swapped_out = data[:pages_swapped_out] @interrupts = data[:interrupts] @cpu_context_switches = data[:cpu_context_switches] @boot_time = data[:boot_time] @forks = data[:forks] else return false end true end |