Iostat refactor
Signed-off-by: Katarzyna Treder <katarzyna.treder@h-partners.com>
This commit is contained in:
parent
70defbdf0d
commit
940990e37a
@ -62,7 +62,7 @@ def test_ci_read(cache_mode):
|
|||||||
dd.run()
|
dd.run()
|
||||||
|
|
||||||
with TestRun.step("Collect iostat"):
|
with TestRun.step("Collect iostat"):
|
||||||
iostat = IOstatBasic.get_iostat_list([cache_device.parent_device])
|
iostat = IOstatBasic.get_iostat_list([cache_device.parent_device.get_device_id()])
|
||||||
read_cache_1 = iostat[0].total_reads
|
read_cache_1 = iostat[0].total_reads
|
||||||
|
|
||||||
with TestRun.step("Generate cache hits using reads"):
|
with TestRun.step("Generate cache hits using reads"):
|
||||||
@ -77,7 +77,7 @@ def test_ci_read(cache_mode):
|
|||||||
dd.run()
|
dd.run()
|
||||||
|
|
||||||
with TestRun.step("Collect iostat"):
|
with TestRun.step("Collect iostat"):
|
||||||
iostat = IOstatBasic.get_iostat_list([cache_device.parent_device])
|
iostat = IOstatBasic.get_iostat_list([cache_device.parent_device.get_device_id()])
|
||||||
read_cache_2 = iostat[0].total_reads
|
read_cache_2 = iostat[0].total_reads
|
||||||
|
|
||||||
with TestRun.step("Stop cache"):
|
with TestRun.step("Stop cache"):
|
||||||
@ -117,10 +117,10 @@ def test_ci_write_around_write():
|
|||||||
casadm.add_core(cache, core_device)
|
casadm.add_core(cache, core_device)
|
||||||
|
|
||||||
with TestRun.step("Collect iostat before I/O"):
|
with TestRun.step("Collect iostat before I/O"):
|
||||||
iostat_core = IOstatBasic.get_iostat_list([core_device.parent_device])
|
iostat_core = IOstatBasic.get_iostat_list([core_device.parent_device.get_device_id()])
|
||||||
write_core_0 = iostat_core[0].total_writes
|
write_core_0 = iostat_core[0].total_writes
|
||||||
|
|
||||||
iostat_cache = IOstatBasic.get_iostat_list([cache_device.parent_device])
|
iostat_cache = IOstatBasic.get_iostat_list([cache_device.parent_device.get_device_id()])
|
||||||
write_cache_0 = iostat_cache[0].total_writes
|
write_cache_0 = iostat_cache[0].total_writes
|
||||||
|
|
||||||
with TestRun.step("Submit writes to exported object"):
|
with TestRun.step("Submit writes to exported object"):
|
||||||
@ -136,11 +136,11 @@ def test_ci_write_around_write():
|
|||||||
dd.run()
|
dd.run()
|
||||||
|
|
||||||
with TestRun.step("Collect iostat"):
|
with TestRun.step("Collect iostat"):
|
||||||
iostat_core = IOstatBasic.get_iostat_list([core_device.parent_device])
|
iostat_core = IOstatBasic.get_iostat_list([core_device.parent_device.get_device_id()])
|
||||||
write_core_1 = iostat_core[0].total_writes
|
write_core_1 = iostat_core[0].total_writes
|
||||||
read_core_1 = iostat_core[0].total_reads
|
read_core_1 = iostat_core[0].total_reads
|
||||||
|
|
||||||
iostat_cache = IOstatBasic.get_iostat_list([cache_device.parent_device])
|
iostat_cache = IOstatBasic.get_iostat_list([cache_device.parent_device.get_device_id()])
|
||||||
write_cache_1 = iostat_cache[0].total_writes
|
write_cache_1 = iostat_cache[0].total_writes
|
||||||
read_cache_1 = iostat_cache[0].total_reads
|
read_cache_1 = iostat_cache[0].total_reads
|
||||||
|
|
||||||
@ -156,10 +156,10 @@ def test_ci_write_around_write():
|
|||||||
dd.run()
|
dd.run()
|
||||||
|
|
||||||
with TestRun.step("Collect iostat"):
|
with TestRun.step("Collect iostat"):
|
||||||
iostat_core = IOstatBasic.get_iostat_list([core_device.parent_device])
|
iostat_core = IOstatBasic.get_iostat_list([core_device.parent_device.get_device_id()])
|
||||||
read_core_2 = iostat_core[0].total_reads
|
read_core_2 = iostat_core[0].total_reads
|
||||||
|
|
||||||
iostat_cache = IOstatBasic.get_iostat_list([cache_device.parent_device])
|
iostat_cache = IOstatBasic.get_iostat_list([cache_device.parent_device.get_device_id()])
|
||||||
read_cache_2 = iostat_cache[0].total_reads
|
read_cache_2 = iostat_cache[0].total_reads
|
||||||
|
|
||||||
with TestRun.step("Stop cache"):
|
with TestRun.step("Stop cache"):
|
||||||
@ -221,10 +221,10 @@ def test_ci_write_through_write():
|
|||||||
casadm.add_core(cache, core_device)
|
casadm.add_core(cache, core_device)
|
||||||
|
|
||||||
with TestRun.step("Collect iostat before I/O"):
|
with TestRun.step("Collect iostat before I/O"):
|
||||||
iostat_core = IOstatBasic.get_iostat_list([core_device.parent_device])
|
iostat_core = IOstatBasic.get_iostat_list([core_device.parent_device.get_device_id()])
|
||||||
write_core_0 = iostat_core[0].total_writes
|
write_core_0 = iostat_core[0].total_writes
|
||||||
|
|
||||||
iostat_cache = IOstatBasic.get_iostat_list([cache_device.parent_device])
|
iostat_cache = IOstatBasic.get_iostat_list([cache_device.parent_device.get_device_id()])
|
||||||
write_cache_0 = iostat_cache[0].total_writes
|
write_cache_0 = iostat_cache[0].total_writes
|
||||||
|
|
||||||
with TestRun.step("Insert data into the cache using writes"):
|
with TestRun.step("Insert data into the cache using writes"):
|
||||||
@ -241,11 +241,11 @@ def test_ci_write_through_write():
|
|||||||
dd.run()
|
dd.run()
|
||||||
|
|
||||||
with TestRun.step("Collect iostat"):
|
with TestRun.step("Collect iostat"):
|
||||||
iostat_core = IOstatBasic.get_iostat_list([core_device.parent_device])
|
iostat_core = IOstatBasic.get_iostat_list([core_device.parent_device.get_device_id()])
|
||||||
write_core_1 = iostat_core[0].total_writes
|
write_core_1 = iostat_core[0].total_writes
|
||||||
read_core_1 = iostat_core[0].total_reads
|
read_core_1 = iostat_core[0].total_reads
|
||||||
|
|
||||||
iostat_cache = IOstatBasic.get_iostat_list([cache_device.parent_device])
|
iostat_cache = IOstatBasic.get_iostat_list([cache_device.parent_device.get_device_id()])
|
||||||
write_cache_1 = iostat_cache[0].total_writes
|
write_cache_1 = iostat_cache[0].total_writes
|
||||||
read_cache_1 = iostat_cache[0].total_reads
|
read_cache_1 = iostat_cache[0].total_reads
|
||||||
|
|
||||||
@ -262,10 +262,10 @@ def test_ci_write_through_write():
|
|||||||
dd.run()
|
dd.run()
|
||||||
|
|
||||||
with TestRun.step("Collect iostat"):
|
with TestRun.step("Collect iostat"):
|
||||||
iostat_core = IOstatBasic.get_iostat_list([core_device.parent_device])
|
iostat_core = IOstatBasic.get_iostat_list([core_device.parent_device.get_device_id()])
|
||||||
read_core_2 = iostat_core[0].total_reads
|
read_core_2 = iostat_core[0].total_reads
|
||||||
|
|
||||||
iostat_cache = IOstatBasic.get_iostat_list([cache_device.parent_device])
|
iostat_cache = IOstatBasic.get_iostat_list([cache_device.parent_device.get_device_id()])
|
||||||
read_cache_2 = iostat_cache[0].total_reads
|
read_cache_2 = iostat_cache[0].total_reads
|
||||||
|
|
||||||
with TestRun.step("Stop cache"):
|
with TestRun.step("Stop cache"):
|
||||||
|
@ -372,4 +372,4 @@ def test_clean_remove_core_without_fs(cache_mode):
|
|||||||
|
|
||||||
|
|
||||||
def check_device_write_stats(device: Device):
|
def check_device_write_stats(device: Device):
|
||||||
return IOstatBasic.get_iostat_list(devices_list=[device])[0].total_writes.value
|
return IOstatBasic.get_iostat_list(devices_list=[device.get_device_id()])[0].total_writes.value
|
||||||
|
@ -89,10 +89,14 @@ def test_wb_throttling():
|
|||||||
with TestRun.step("Wait for IO processes to finish and print debug informations"):
|
with TestRun.step("Wait for IO processes to finish and print debug informations"):
|
||||||
sleep_interval = timedelta(seconds=5)
|
sleep_interval = timedelta(seconds=5)
|
||||||
eta = runtime
|
eta = runtime
|
||||||
while eta.total_seconds() > 0:
|
while int(eta.total_seconds()) > 0:
|
||||||
# Instead of explicit sleeping with `time.sleep()` iostat is used for waiting
|
# Instead of explicit sleeping with `time.sleep()` iostat is used for waiting
|
||||||
iostat = IOstatExtended.get_iostat_list(
|
iostat = IOstatExtended.get_iostat_list(
|
||||||
[core, cache_device, core_device],
|
[
|
||||||
|
core.get_device_id(),
|
||||||
|
cache_device.get_device_id(),
|
||||||
|
core_device.get_device_id()
|
||||||
|
],
|
||||||
since_boot=False,
|
since_boot=False,
|
||||||
interval=int(sleep_interval.total_seconds()),
|
interval=int(sleep_interval.total_seconds()),
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user