Skip to content
Merged
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
14 changes: 12 additions & 2 deletions test/functional/api/cas/ioclass_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
DEFAULT_IO_CLASS_ID = 0
DEFAULT_IO_CLASS_PRIORITY = 255
DEFAULT_IO_CLASS_RULE = "unclassified"
PREFETCH_IO_CLASS_ID = 33
PREFETCH_IO_CLASS_RULE = "prefetch"
MAX_CLASSIFICATION_DELAY = timedelta(seconds=6)
IO_CLASS_CONFIG_HEADER = "IO class id,IO class name,Eviction priority,Allocation"

Expand Down Expand Up @@ -117,6 +119,10 @@ def save_list_to_config_file(
def default(priority=DEFAULT_IO_CLASS_PRIORITY, allocation="1.00"):
return IoClass(DEFAULT_IO_CLASS_ID, DEFAULT_IO_CLASS_RULE, priority, allocation)

@staticmethod
def prefetch(priority=DEFAULT_IO_CLASS_PRIORITY, allocation="1.00"):
return IoClass(PREFETCH_IO_CLASS_ID, PREFETCH_IO_CLASS_RULE, priority, allocation)

@staticmethod
def default_header_dict():
return {
Expand All @@ -140,9 +146,13 @@ def generate_random_ioclass_list(count: int, max_priority: int = MAX_IO_CLASS_PR
IoClass.default(
priority=random.randint(0, max_priority),
allocation=f"{random.randint(0, 100) / 100:0.2f}",
)
),
IoClass.prefetch(
priority=random.randint(0, max_priority),
allocation=f"{random.randint(0, 100) / 100:0.2f}",
),
]
for i in range(1, count):
for i in range(1, count - 1):
random_list.append(
IoClass(
i,
Expand Down
Loading