class Vmstat::Disk

Gathered disk statistics snapshot. @attr [Symbol] type

The file system name e. g. *hfs*.

@attr [String] origin

The location of the device e.g. */dev/disk0*.

@attr [String] mount

The mount point of the device e.g. */mnt/store*.

@attr [Fixnum] block_size

Size of file system blocks in bytes.

@attr [Fixnum] free_blocks

Free blocks in the file system.

@attr [Fixnum] available_blocks

Available blocks in the file system.

@attr [Fixnum] total_blocks

Total number of blocks in the file system.

Public Instance Methods

available_bytes() click to toggle source

Calculates the number of available bytes for the file system. @return [Fixnum] number of available bytes

# File lib/vmstat/disk.rb, line 27
def available_bytes
  available_blocks * block_size
end
free_bytes() click to toggle source

@return [Fixnum] number of free bytes

# File lib/vmstat/disk.rb, line 21
def free_bytes
  free_blocks * block_size
end
total_bytes() click to toggle source

Calculates the number of total bytes for the file system. This is the max. number of bytes possible on the device. @return [Fixnum] number of total bytes

# File lib/vmstat/disk.rb, line 40
def total_bytes
  total_blocks * block_size
end
used_bytes() click to toggle source

Calculates the number of used bytes for the file system. @return [Fixnum] number of used bytes

# File lib/vmstat/disk.rb, line 33
def used_bytes
  (total_blocks - free_blocks) * block_size
end