def get_io_class_list(cache_id: int): ret = [] casadm_output = casadm.list_io_classes( cache_id, OutputFormat.csv).stdout.splitlines() casadm_output.pop(0) # Remove header for line in casadm_output: values = line.split(",") ioclass = IoClass(int(values[0]), values[1], int(values[2]), values[3]) ret.append(ioclass) return ret
def load_io_classes_in_permutation_order(rules, permutation, cache): ioclass_config.remove_ioclass_config(ioclass_config_path=ioclass_config_path) ioclass_config.create_ioclass_config( add_default_rule=False, ioclass_config_path=ioclass_config_path ) # To make test more precise all workload except of tested ioclass should be # put in pass-through mode ioclass_list = [IoClass.default(allocation=False)] for n in range(len(rules)): ioclass_list.append(IoClass(class_id=permutation[n], rule=rules[n])) IoClass.save_list_to_config_file(ioclass_list, add_default_rule=False, ioclass_config_path=ioclass_config_path) casadm.load_io_classes(cache.cache_id, file=ioclass_config_path)