Class: Vmstator::Memory
Direct Known Subclasses
Instance Attribute Summary collapse
-
#blocks_recv ⇒ Object
readonly
blocks received from a device (blocks/s).
-
#blocks_sent ⇒ Object
readonly
blocks sent to a block device (blocks/s).
-
#buffer ⇒ Object
readonly
amount of memory used as buffers.
-
#cache ⇒ Object
readonly
amount of memory used as cache.
-
#cntxt_swtchs ⇒ Object
readonly
number of context switches (/s).
-
#free ⇒ Object
readonly
amount of idle memory.
-
#idle_time ⇒ Object
readonly
time spent idle.
-
#interrupts ⇒ Object
readonly
number of interrupts (/s).
-
#kernel ⇒ Object
readonly
time spent running kernel code.
-
#non_kernel ⇒ Object
readonly
time spent running non-kernel code.
-
#runnable ⇒ Object
readonly
number of runnable processes.
-
#stolen ⇒ Object
readonly
time stolen from a virtual machine.
-
#swapped_in ⇒ Object
readonly
amount of memory swapped in from disk (/s).
-
#swapped_to ⇒ Object
readonly
amount memory swapped to disk (/s).
-
#uninter ⇒ Object
readonly
number of processes in uninterruptible sleep.
-
#used ⇒ Object
readonly
amount of virtual memory used.
-
#waiting ⇒ Object
readonly
time spent waiting for IO.
Attributes inherited from Stats
Instance Method Summary collapse
Methods inherited from Stats
Constructor Details
This class inherits a constructor from Vmstator::Stats
Instance Attribute Details
#blocks_recv ⇒ Object (readonly)
blocks received from a device (blocks/s)
12 13 14 |
# File 'lib/vmstator/memory.rb', line 12 def blocks_recv @blocks_recv end |
#blocks_sent ⇒ Object (readonly)
blocks sent to a block device (blocks/s)
13 14 15 |
# File 'lib/vmstator/memory.rb', line 13 def blocks_sent @blocks_sent end |
#buffer ⇒ Object (readonly)
amount of memory used as buffers
8 9 10 |
# File 'lib/vmstator/memory.rb', line 8 def buffer @buffer end |
#cache ⇒ Object (readonly)
amount of memory used as cache
9 10 11 |
# File 'lib/vmstator/memory.rb', line 9 def cache @cache end |
#cntxt_swtchs ⇒ Object (readonly)
number of context switches (/s)
15 16 17 |
# File 'lib/vmstator/memory.rb', line 15 def cntxt_swtchs @cntxt_swtchs end |
#free ⇒ Object (readonly)
amount of idle memory
7 8 9 |
# File 'lib/vmstator/memory.rb', line 7 def free @free end |
#idle_time ⇒ Object (readonly)
time spent idle
18 19 20 |
# File 'lib/vmstator/memory.rb', line 18 def idle_time @idle_time end |
#interrupts ⇒ Object (readonly)
number of interrupts (/s)
14 15 16 |
# File 'lib/vmstator/memory.rb', line 14 def interrupts @interrupts end |
#kernel ⇒ Object (readonly)
time spent running kernel code
17 18 19 |
# File 'lib/vmstator/memory.rb', line 17 def kernel @kernel end |
#non_kernel ⇒ Object (readonly)
time spent running non-kernel code
16 17 18 |
# File 'lib/vmstator/memory.rb', line 16 def non_kernel @non_kernel end |
#runnable ⇒ Object (readonly)
number of runnable processes
4 5 6 |
# File 'lib/vmstator/memory.rb', line 4 def runnable @runnable end |
#stolen ⇒ Object (readonly)
time stolen from a virtual machine
20 21 22 |
# File 'lib/vmstator/memory.rb', line 20 def stolen @stolen end |
#swapped_in ⇒ Object (readonly)
amount of memory swapped in from disk (/s)
10 11 12 |
# File 'lib/vmstator/memory.rb', line 10 def swapped_in @swapped_in end |
#swapped_to ⇒ Object (readonly)
amount memory swapped to disk (/s)
11 12 13 |
# File 'lib/vmstator/memory.rb', line 11 def swapped_to @swapped_to end |
#uninter ⇒ Object (readonly)
number of processes in uninterruptible sleep
5 6 7 |
# File 'lib/vmstator/memory.rb', line 5 def uninter @uninter end |
#used ⇒ Object (readonly)
amount of virtual memory used
6 7 8 |
# File 'lib/vmstator/memory.rb', line 6 def used @used end |
#waiting ⇒ Object (readonly)
time spent waiting for IO
19 20 21 |
# File 'lib/vmstator/memory.rb', line 19 def waiting @waiting end |
Instance Method Details
#update(data) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/vmstator/memory.rb', line 22 def update(data) if data @runnable = data[:r] @uninter = data[:b] @swapped_in = data[:si] @swapped_to = data[:so] @blocks_recv = data[:bi] @blocks_sent = data[:bo] @interrupts = data[:in] @cntxt_swtchs = data[:cs] @non_kernel = data[:us] @kernel = data[:sy] @idle_time = data[:id] @waiting = data[:wa] @stolen = data[:st] @used = data[:swpd] @free = data[:free] if self.is_a? AverageMemory @cache = data[:cache] @buffer = data[:buff] else @cache = false @buffer = false end else return false end true end |