Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/functional/api/cas/cli_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@

get_stats_ioclass_id_not_configured = [r"IO class \d+ is not configured\."]

get_stats_ioclass_id_out_of_range = [r"Invalid IO class id, must be in the range 0-32\."]
get_stats_ioclass_id_out_of_range = [r"Invalid IO class id, must be in the range 0-33\."]

remove_multilevel_core = [
r"Error while removing core device \d+ from cache instance \d+",
Expand Down Expand Up @@ -240,7 +240,7 @@
]

illegal_io_class_invalid_id_number = [
r"Invalid id, must be in the range 0-32\.\n"
r"Invalid id, must be in the range 0-33\.\n"
r"Cannot parse configuration file - error in line 2 in column 1 \(IO class id\)\."
]

Expand Down
2 changes: 1 addition & 1 deletion test/functional/api/cas/ioclass_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

default_config_file_path = TestRun.TEST_RUN_DATA_PATH + "/opencas_ioclass.conf"

MAX_IO_CLASS_ID = 32
MAX_IO_CLASS_ID = 33
MAX_IO_CLASS_PRIORITY = 255
DEFAULT_IO_CLASS_ID = 0
DEFAULT_IO_CLASS_PRIORITY = 255
Expand Down
72 changes: 71 additions & 1 deletion test/functional/api/cas/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ def __init__(self, stats_dict):
self.write_policy = stats_dict["Write Policy"]
self.cleaning_policy = stats_dict["Cleaning Policy"]
self.promotion_policy = stats_dict["Promotion Policy"]
self.prefetch_policy = stats_dict["Prefetch Policy"]
self.cache_line_size = parse_value(
value=stats_dict["Cache line size [KiB]"], unit_type=UnitType.kibibyte
)
Expand All @@ -213,6 +214,7 @@ def __init__(self, stats_dict):
del stats_dict["Write Policy"]
del stats_dict["Cleaning Policy"]
del stats_dict["Promotion Policy"]
del stats_dict["Prefetch Policy"]
del stats_dict["Cache line size [KiB]"]
del stats_dict[footprint_key]
del stats_dict["Dirty for [s]"]
Expand All @@ -231,6 +233,7 @@ def __str__(self):
f"Write Policy: {self.write_policy}\n"
f"Cleaning Policy: {self.cleaning_policy}\n"
f"Promotion Policy: {self.promotion_policy}\n"
f"Prefetch Policy: {self.prefetch_policy}\n"
f"Cache line size: {self.cache_line_size}\n"
f"Metadata memory footprint: {self.metadata_memory_footprint}\n"
f"Dirty for: {self.dirty_for}\n"
Expand All @@ -250,6 +253,7 @@ def __eq__(self, other):
and self.write_policy == other.write_policy
and self.cleaning_policy == other.cleaning_policy
and self.promotion_policy == other.promotion_policy
and self.prefetch_policy == other.prefetch_policy
and self.cache_line_size == other.cache_line_size
and self.metadata_memory_footprint == other.metadata_memory_footprint
and self.dirty_for == other.dirty_for
Expand Down Expand Up @@ -474,6 +478,15 @@ def __init__(self, stats_dict, percentage_val: bool = False):
self.requests_serviced = parse_value(
value=stats_dict[f"Serviced requests {unit}"], unit_type=unit
)
self.prefetch_readahead = parse_value(
value=stats_dict[f"Prefetch: readahead {unit}"], unit_type=unit
)
self.cleaner = parse_value(
value=stats_dict[f"Cleaner {unit}"], unit_type=unit
)
self.requests_user = parse_value(
value=stats_dict[f"User requests {unit}"], unit_type=unit
)
self.requests_total = parse_value(
value=stats_dict[f"Total requests {unit}"], unit_type=unit
)
Expand All @@ -488,6 +501,9 @@ def __init__(self, stats_dict, percentage_val: bool = False):
del stats_dict[f"Pass-Through reads {unit}"]
del stats_dict[f"Pass-Through writes {unit}"]
del stats_dict[f"Serviced requests {unit}"]
del stats_dict[f"Prefetch: readahead {unit}"]
del stats_dict[f"Cleaner {unit}"]
del stats_dict[f"User requests {unit}"]
del stats_dict[f"Total requests {unit}"]

def __str__(self):
Expand All @@ -498,6 +514,9 @@ def __str__(self):
f"Pass-through reads: {self.pass_through_reads}\n"
f"Pass-through writes: {self.pass_through_writes}\n"
f"Serviced requests: {self.requests_serviced}\n"
f"Prefetch readahead: {self.prefetch_readahead}\n"
f"Cleaner: {self.cleaner}\n"
f"User requests: {self.requests_user}\n"
f"Total requests: {self.requests_total}\n"
)

Expand All @@ -510,6 +529,9 @@ def __eq__(self, other):
and self.pass_through_reads == other.pass_through_reads
and self.pass_through_writes == other.pass_through_writes
and self.requests_serviced == other.requests_serviced
and self.prefetch_readahead == other.prefetch_readahead
and self.cleaner == other.cleaner
and self.requests_user == other.requests_user
and self.requests_total == other.requests_total
)

Expand All @@ -522,6 +544,9 @@ def __add__(self, other):
stats.pass_through_reads = self.pass_through_reads + other.pass_through_reads
stats.pass_through_writes = self.pass_through_writes + other.pass_through_writes
stats.requests_serviced = self.requests_serviced + other.requests_serviced
stats.prefetch_readahead = self.prefetch_readahead + other.prefetch_readahead
stats.cleaner = self.cleaner + other.cleaner
stats.requests_user = self.requests_user + other.requests_user
stats.requests_total = self.requests_total + other.requests_total
return stats

Expand All @@ -544,6 +569,9 @@ def zero(cls, percentage_val: bool = False):
f"Pass-Through reads {unit}" : 0,
f"Pass-Through writes {unit}" : 0,
f"Serviced requests {unit}" : 0,
f"Prefetch: readahead {unit}" : 0,
f"Cleaner {unit}" : 0,
f"User requests {unit}" : 0,
f"Total requests {unit}" : 0,
})
return cls(stats_dict, percentage_val)
Expand Down Expand Up @@ -613,25 +641,53 @@ def __init__(self, stats_dict, percentage_val: bool = False):
device="exported object",
)

unit = UnitType.percentage if percentage_val else UnitType.block_4k
self.prefetch_core_reads_readahead = parse_value(
value=stats_dict[f"Prefetch core reads: readahead {unit}"], unit_type=unit
)
self.prefetch_cache_writes_readahead = parse_value(
value=stats_dict[f"Prefetch cache writes: readahead {unit}"], unit_type=unit
)
self.cleaner_cache_reads = parse_value(
value=stats_dict[f"Cleaner cache reads {unit}"], unit_type=unit
)
self.cleaner_core_writes = parse_value(
value=stats_dict[f"Cleaner core writes {unit}"], unit_type=unit
)

for unit in [UnitType.percentage, UnitType.block_4k]:
for device in ["core", "cache", "exported object"]:
del stats_dict[f"Reads from {device} {unit}"]
del stats_dict[f"Writes to {device} {unit}"]
del stats_dict[f"Total to/from {device} {unit}"]
del stats_dict[f"Prefetch core reads: readahead {unit}"]
del stats_dict[f"Prefetch cache writes: readahead {unit}"]
del stats_dict[f"Cleaner cache reads {unit}"]
del stats_dict[f"Cleaner core writes {unit}"]

def __str__(self):
return (
f"Block stats:\n"
f"Core(s):\n{self.core}"
f"Cache:\n{self.cache}"
f"Exported object(s):\n{self.exp_obj}"
f"Prefetch core reads (readahead): {self.prefetch_core_reads_readahead}\n"
f"Prefetch cache writes (readahead): {self.prefetch_cache_writes_readahead}\n"
f"Cleaner cache reads: {self.cleaner_cache_reads}\n"
f"Cleaner core writes: {self.cleaner_core_writes}\n"
)

def __eq__(self, other):
if not other:
return False
return (
self.core == other.core and self.cache == other.cache and self.exp_obj == other.exp_obj
self.core == other.core
and self.cache == other.cache
and self.exp_obj == other.exp_obj
and self.prefetch_core_reads_readahead == other.prefetch_core_reads_readahead
and self.prefetch_cache_writes_readahead == other.prefetch_cache_writes_readahead
and self.cleaner_cache_reads == other.cleaner_cache_reads
and self.cleaner_core_writes == other.cleaner_core_writes
)

def __add__(self, other):
Expand All @@ -641,6 +697,14 @@ def __add__(self, other):
stats.core = self.core + other.core
stats.cache = self.cache + other.cache
stats.exp_obj = self.exp_obj + other.exp_obj
stats.prefetch_core_reads_readahead = (
self.prefetch_core_reads_readahead + other.prefetch_core_reads_readahead
)
stats.prefetch_cache_writes_readahead = (
self.prefetch_cache_writes_readahead + other.prefetch_cache_writes_readahead
)
stats.cleaner_cache_reads = self.cleaner_cache_reads + other.cleaner_cache_reads
stats.cleaner_core_writes = self.cleaner_core_writes + other.cleaner_core_writes
return stats

def __iter__(self):
Expand All @@ -656,6 +720,12 @@ def zero(cls, percentage_val: bool = False):
f"Writes to {device} {unit}" : 0,
f"Total to/from {device} {unit}" : 0,
})
stats_dict.update({
f"Prefetch core reads: readahead {unit}" : 0,
f"Prefetch cache writes: readahead {unit}" : 0,
f"Cleaner cache reads {unit}" : 0,
f"Cleaner core writes {unit}" : 0,
})
return cls(stats_dict, percentage_val)


Expand Down
16 changes: 15 additions & 1 deletion test/functional/tests/stats/test_display_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@
"Pass-Through writes [%]",
"Serviced requests [Requests]",
"Serviced requests [%]",
"Prefetch: readahead [Requests]",
"Prefetch: readahead [%]",
"Cleaner [Requests]",
"Cleaner [%]",
"User requests [Requests]",
"User requests [%]",
"Total requests [Requests]",
"Total requests [%]"
]
Expand All @@ -93,7 +99,15 @@
"Writes to exported object [4KiB Blocks]",
"Writes to exported object [%]",
"Total to/from exported object [4KiB Blocks]",
"Total to/from exported object [%]"
"Total to/from exported object [%]",
"Prefetch core reads: readahead [4KiB Blocks]",
"Prefetch core reads: readahead [%]",
"Prefetch cache writes: readahead [4KiB Blocks]",
"Prefetch cache writes: readahead [%]",
"Cleaner cache reads [4KiB Blocks]",
"Cleaner cache reads [%]",
"Cleaner core writes [4KiB Blocks]",
"Cleaner core writes [%]"
]

error_stats = [
Expand Down
16 changes: 15 additions & 1 deletion test/functional/tests/stats/test_ioclass_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@
"Pass-Through writes [%]",
"Serviced requests [Requests]",
"Serviced requests [%]",
"Prefetch: readahead [Requests]",
"Prefetch: readahead [%]",
"Cleaner [Requests]",
"Cleaner [%]",
"User requests [Requests]",
"User requests [%]",
"Total requests [Requests]",
"Total requests [%]"
]
Expand All @@ -98,7 +104,15 @@
"Writes to exported object [4KiB Blocks]",
"Writes to exported object [%]",
"Total to/from exported object [4KiB Blocks]",
"Total to/from exported object [%]"
"Total to/from exported object [%]",
"Prefetch core reads: readahead [4KiB Blocks]",
"Prefetch core reads: readahead [%]",
"Prefetch cache writes: readahead [4KiB Blocks]",
"Prefetch cache writes: readahead [%]",
"Cleaner cache reads [4KiB Blocks]",
"Cleaner cache reads [%]",
"Cleaner core writes [4KiB Blocks]",
"Cleaner core writes [%]"
]

@pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand]))
Expand Down
Loading