class ForemanMaintain::Utils::Disk::IO::BlockDevice

Attributes

dir[RW]
name[RW]
read_speed[RW]
unit[RW]

Public Class Methods

new(dir, name = Disk::Device.new('/var').name) click to toggle source
# File lib/foreman_maintain/utils/disk/io/block_device.rb, line 10
def initialize(dir, name = Disk::Device.new('/var').name)
  @dir = dir
  @name = name
end

Private Instance Methods

extract_speed(stdout) click to toggle source
# File lib/foreman_maintain/utils/disk/io/block_device.rb, line 33
def extract_speed(stdout)
  stdout.split(' ').reverse[1].to_i
end
extract_unit(stdout) click to toggle source
# File lib/foreman_maintain/utils/disk/io/block_device.rb, line 29
def extract_unit(stdout)
  stdout.split(' ').last
end
hdparm() click to toggle source
# File lib/foreman_maintain/utils/disk/io/block_device.rb, line 25
def hdparm
  @stdout ||= execute("hdparm -t #{name} | awk 'NF'")
end