Class: Vmstat::Disk
- Inherits:
-
Struct
- Object
- Struct
- Vmstat::Disk
- Defined in:
- lib/vmstat/disk.rb
Overview
Gathered disk statistics snapshot.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#available_blocks ⇒ Fixnum
Available blocks in the file system.
-
#block_size ⇒ Fixnum
Size of file system blocks in bytes.
-
#free_blocks ⇒ Fixnum
Free blocks in the file system.
-
#mount ⇒ String
The mount point of the device e.g.
-
#origin ⇒ String
The location of the device e.g.
-
#total_blocks ⇒ Fixnum
Total number of blocks in the file system.
-
#type ⇒ Symbol
The file system name e.
Instance Method Summary collapse
-
#available_bytes ⇒ Fixnum
Calculates the number of available bytes for the file system.
-
#free_bytes ⇒ Fixnum
Calculates the number of free bytes for the file system.
-
#total_bytes ⇒ Fixnum
Calculates the number of total bytes for the file system.
-
#used_bytes ⇒ Fixnum
Calculates the number of used bytes for the file system.
Instance Attribute Details
#available_blocks ⇒ Fixnum
Available blocks in the file system.
17 18 19 |
# File 'lib/vmstat/disk.rb', line 17 def available_blocks @available_blocks end |
#block_size ⇒ Fixnum
Size of file system blocks in bytes.
17 18 19 |
# File 'lib/vmstat/disk.rb', line 17 def block_size @block_size end |
#free_blocks ⇒ Fixnum
Free blocks in the file system.
17 18 19 |
# File 'lib/vmstat/disk.rb', line 17 def free_blocks @free_blocks end |
#mount ⇒ String
The mount point of the device e.g. /mnt/store.
17 18 19 |
# File 'lib/vmstat/disk.rb', line 17 def mount @mount end |
#origin ⇒ String
The location of the device e.g. /dev/disk0.
17 18 19 |
# File 'lib/vmstat/disk.rb', line 17 def origin @origin end |
#total_blocks ⇒ Fixnum
Total number of blocks in the file system.
17 18 19 |
# File 'lib/vmstat/disk.rb', line 17 def total_blocks @total_blocks end |
#type ⇒ Symbol
The file system name e. g. hfs.
17 18 19 |
# File 'lib/vmstat/disk.rb', line 17 def type @type end |
Instance Method Details
#available_bytes ⇒ Fixnum
Calculates the number of available bytes for the file system.
27 28 29 |
# File 'lib/vmstat/disk.rb', line 27 def available_bytes available_blocks * block_size end |
#free_bytes ⇒ Fixnum
Calculates the number of free bytes for the file system.
21 22 23 |
# File 'lib/vmstat/disk.rb', line 21 def free_bytes free_blocks * block_size end |
#total_bytes ⇒ Fixnum
Calculates the number of total bytes for the file system. This is the max. number of bytes possible on the device.
40 41 42 |
# File 'lib/vmstat/disk.rb', line 40 def total_bytes total_blocks * block_size end |
#used_bytes ⇒ Fixnum
Calculates the number of used bytes for the file system.
33 34 35 |
# File 'lib/vmstat/disk.rb', line 33 def used_bytes (total_blocks - free_blocks) * block_size end |