Class: ForemanMaintain::Utils::Disk::Device
- Inherits:
-
Object
- Object
- ForemanMaintain::Utils::Disk::Device
- Extended by:
- Forwardable
- Includes:
- Concerns::SystemHelpers
- Defined in:
- lib/foreman_maintain/utils/disk/device.rb
Constant Summary collapse
- EXTERNAL_MOUNT_TYPE =
%w[fuseblk nfs].freeze
Instance Attribute Summary collapse
-
#dir ⇒ Object
Returns the value of attribute dir.
-
#io_device ⇒ Object
readonly
Returns the value of attribute io_device.
-
#name ⇒ Object
Returns the value of attribute name.
-
#read_speed ⇒ Object
Returns the value of attribute read_speed.
-
#unit ⇒ Object
Returns the value of attribute unit.
Instance Method Summary collapse
-
#initialize(dir) ⇒ Device
constructor
A new instance of Device.
- #performance ⇒ Object
- #slow_disk_error_msg ⇒ Object
Methods included from Concerns::SystemHelpers
#check_max_version, #check_min_version, #command_present?, #create_lv_snapshot, #directory_empty?, #execute, #execute!, #execute?, #execute_runner, #execute_with_status, #file_exists?, #file_nonzero?, #find_dir_containing_file, #find_package, #find_symlinks, #format_shell_args, #get_lv_info, #get_lv_path, #hostname, included, #package_manager, #package_version, #packages_action, #parse_csv, #parse_json, #rpm_version, #server?, #shellescape, #systemd_installed?, #version
Methods included from Concerns::Finders
#check, #detector, #feature, #find_all_scenarios, #find_checks, #find_procedures, #find_scenarios, #procedure
Methods included from Concerns::Logger
Constructor Details
Instance Attribute Details
#dir ⇒ Object
Returns the value of attribute dir.
11 12 13 |
# File 'lib/foreman_maintain/utils/disk/device.rb', line 11 def dir @dir end |
#io_device ⇒ Object (readonly)
Returns the value of attribute io_device.
13 14 15 |
# File 'lib/foreman_maintain/utils/disk/device.rb', line 13 def io_device @io_device end |
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/foreman_maintain/utils/disk/device.rb', line 11 def name @name end |
#read_speed ⇒ Object
Returns the value of attribute read_speed.
11 12 13 |
# File 'lib/foreman_maintain/utils/disk/device.rb', line 11 def read_speed @read_speed end |
#unit ⇒ Object
Returns the value of attribute unit.
11 12 13 |
# File 'lib/foreman_maintain/utils/disk/device.rb', line 11 def unit @unit end |
Instance Method Details
#performance ⇒ Object
30 31 32 |
# File 'lib/foreman_maintain/utils/disk/device.rb', line 30 def performance "#{read_speed} #{unit}" end |
#slow_disk_error_msg ⇒ Object
24 25 26 27 28 |
# File 'lib/foreman_maintain/utils/disk/device.rb', line 24 def slow_disk_error_msg "Slow disk detected #{dir} mounted on #{name}. Actual disk speed: #{read_speed} #{default_unit} Expected disk speed: #{expected_io} #{default_unit}." end |