add intermediary results ssave
This commit is contained in:
@@ -7,17 +7,20 @@ from uuid import uuid4
|
|||||||
class Results:
|
class Results:
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.result_list = [["Run num", "test_case", "files", "MB/s", "time", "full size"]]
|
self.result_list = [["Run num", "test_case", "files", "MB/s", "time", "full size"]]
|
||||||
|
self.name = f"results{uuid4()}.csv"
|
||||||
|
|
||||||
def add(self, row: list) -> None:
|
def add(self, row: list, save: bool = True) -> None:
|
||||||
"""Add a row to the results lists.
|
"""Add a row to the results lists.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
row (list): a row of results.
|
row (list): a row of results.
|
||||||
"""
|
"""
|
||||||
self.result_list.append(row)
|
self.result_list.append(row)
|
||||||
|
if save:
|
||||||
|
self.save()
|
||||||
|
|
||||||
def save_to_csv(self) -> None:
|
def save_to_csv(self) -> None:
|
||||||
"""Save results to csv file in the current directory."""
|
"""Save results to csv file in the current directory."""
|
||||||
with open(f"results{uuid4()}.csv", "w") as f:
|
with open(self.name, "w") as f:
|
||||||
cw = csv.writer(f)
|
cw = csv.writer(f)
|
||||||
cw.writerows(self.result_list)
|
cw.writerows(self.result_list)
|
||||||
|
|||||||
2
run.py
2
run.py
@@ -21,7 +21,7 @@ def local():
|
|||||||
click.echo("Running locally")
|
click.echo("Running locally")
|
||||||
for runnum in range(50):
|
for runnum in range(50):
|
||||||
for files_type in BENCH_DIR_NAMES:
|
for files_type in BENCH_DIR_NAMES:
|
||||||
test_case = "Distant-InsSto to InsSto"
|
test_case = "Local-InsSto to CEPH"
|
||||||
source = f"{INST_STO_ROOT}/{files_type}"
|
source = f"{INST_STO_ROOT}/{files_type}"
|
||||||
target = CEPH_ROOT + files_type
|
target = CEPH_ROOT + files_type
|
||||||
run_single_bench(
|
run_single_bench(
|
||||||
|
|||||||
Reference in New Issue
Block a user