Class: Vmstat::Memory
- Inherits:
-
Struct
- Object
- Struct
- Vmstat::Memory
- Defined in:
- lib/vmstat/memory.rb
Overview
Gathered memory data snapshot.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#active ⇒ Fixnum
The number of active pages in the system.
-
#free ⇒ Fixnum
The number of free pages in the system.
-
#inactive ⇒ Fixnum
The number of inactive pages in the system.
-
#pageins ⇒ Fixnum
The number of pageins.
-
#pageouts ⇒ Fixnum
The number of pageouts.
-
#pagesize ⇒ Fixnum
The page size of the memory in bytes.
-
#wired ⇒ Fixnum
The number of wired pages in the system.
Instance Method Summary collapse
-
#active_bytes ⇒ Fixnum
Calculate the active bytes based of the active pages.
-
#free_bytes ⇒ Fixnum
Calculate the free bytes based of the free pages.
-
#inactive_bytes ⇒ Fixnum
Calculate the inactive bytes based of the inactive pages.
-
#total_bytes ⇒ Fixnum
Calculate the total bytes based of all pages.
-
#wired_bytes ⇒ Fixnum
Calculate the wired bytes based of the wired pages.
Instance Attribute Details
#active ⇒ Fixnum
The number of active pages in the system.
17 18 19 |
# File 'lib/vmstat/memory.rb', line 17 def active @active end |
#free ⇒ Fixnum
The number of free pages in the system.
17 18 19 |
# File 'lib/vmstat/memory.rb', line 17 def free @free end |
#inactive ⇒ Fixnum
The number of inactive pages in the system.
17 18 19 |
# File 'lib/vmstat/memory.rb', line 17 def inactive @inactive end |
#pageins ⇒ Fixnum
The number of pageins.
17 18 19 |
# File 'lib/vmstat/memory.rb', line 17 def pageins @pageins end |
#pageouts ⇒ Fixnum
The number of pageouts.
17 18 19 |
# File 'lib/vmstat/memory.rb', line 17 def pageouts @pageouts end |
#pagesize ⇒ Fixnum
The page size of the memory in bytes.
17 18 19 |
# File 'lib/vmstat/memory.rb', line 17 def pagesize @pagesize end |
#wired ⇒ Fixnum
The number of wired pages in the system.
17 18 19 |
# File 'lib/vmstat/memory.rb', line 17 def wired @wired end |
Instance Method Details
#active_bytes ⇒ Fixnum
Calculate the active bytes based of the active pages.
27 28 29 |
# File 'lib/vmstat/memory.rb', line 27 def active_bytes active * pagesize end |
#free_bytes ⇒ Fixnum
Calculate the free bytes based of the free pages.
39 40 41 |
# File 'lib/vmstat/memory.rb', line 39 def free_bytes free * pagesize end |
#inactive_bytes ⇒ Fixnum
Calculate the inactive bytes based of the inactive pages.
33 34 35 |
# File 'lib/vmstat/memory.rb', line 33 def inactive_bytes inactive * pagesize end |
#total_bytes ⇒ Fixnum
Calculate the total bytes based of all pages
45 46 47 |
# File 'lib/vmstat/memory.rb', line 45 def total_bytes (wired + active + inactive + free) * pagesize end |
#wired_bytes ⇒ Fixnum
Calculate the wired bytes based of the wired pages.
21 22 23 |
# File 'lib/vmstat/memory.rb', line 21 def wired_bytes wired * pagesize end |