moved all files to subproject

This commit is contained in:
alex
2023-09-06 15:49:19 +02:00
parent 83dfdf7841
commit 1069348d71
7 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
# copyright: Canonical
"Tools for managing results."
import csv
from uuid import uuid4
class Results:
def __init__(self, *args, **kwargs):
self.result_list = [["Run num", "test_case", "files", "MB/s", "time", "full size"]]
self.name = f"results{uuid4()}.csv"
def add(self, row: list, save: bool = True) -> None:
"""Add a row to the results lists.
Args:
row (list): a row of results.
"""
self.result_list.append(row)
if save:
self.save()
def save_to_csv(self) -> None:
"""Save results to csv file in the current directory."""
with open(self.name, "w") as f:
cw = csv.writer(f)
cw.writerows(self.result_list)