Improve performance under macOS by using rdisks
This commit is contained in:
parent
0c8701e3e4
commit
5cc0456f40
1 changed files with 7 additions and 1 deletions
|
|
@ -762,6 +762,7 @@ def disk_io_benchmark(state, test_objects, skip_usb=True):
|
||||||
if PLATFORM == 'Darwin':
|
if PLATFORM == 'Darwin':
|
||||||
# Use "RAW" disks under macOS
|
# Use "RAW" disks under macOS
|
||||||
dev_path = dev_path.with_name(f'r{dev_path.name}')
|
dev_path = dev_path.with_name(f'r{dev_path.name}')
|
||||||
|
LOG.info(f'Using {dev_path} for better performance')
|
||||||
offset = 0
|
offset = 0
|
||||||
read_rates = []
|
read_rates = []
|
||||||
test_obj.report.append(std.color_string('I/O Benchmark', 'BLUE'))
|
test_obj.report.append(std.color_string('I/O Benchmark', 'BLUE'))
|
||||||
|
|
@ -979,6 +980,11 @@ def disk_surface_scan(state, test_objects):
|
||||||
"""Run surface scan and handle exceptions."""
|
"""Run surface scan and handle exceptions."""
|
||||||
block_size = '1024'
|
block_size = '1024'
|
||||||
dev = test_obj.dev
|
dev = test_obj.dev
|
||||||
|
dev_path = test_obj.dev.path
|
||||||
|
if PLATFORM == 'Darwin':
|
||||||
|
# Use "RAW" disks under macOS
|
||||||
|
dev_path = dev_path.with_name(f'r{dev_path.name}')
|
||||||
|
LOG.info(f'Using {dev_path} for better performance')
|
||||||
test_obj.report.append(std.color_string('badblocks', 'BLUE'))
|
test_obj.report.append(std.color_string('badblocks', 'BLUE'))
|
||||||
test_obj.set_status('Working')
|
test_obj.set_status('Working')
|
||||||
|
|
||||||
|
|
@ -988,7 +994,7 @@ def disk_surface_scan(state, test_objects):
|
||||||
block_size = '4096'
|
block_size = '4096'
|
||||||
|
|
||||||
# Start scan
|
# Start scan
|
||||||
cmd = ['sudo', 'badblocks', '-sv', '-b', block_size, '-e', '1', dev.path]
|
cmd = ['sudo', 'badblocks', '-sv', '-b', block_size, '-e', '1', dev_path]
|
||||||
with open(log_path, 'a') as _f:
|
with open(log_path, 'a') as _f:
|
||||||
size_str = std.bytes_to_string(dev.details["size"], use_binary=False)
|
size_str = std.bytes_to_string(dev.details["size"], use_binary=False)
|
||||||
_f.write(
|
_f.write(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue