Files
canonical-stuff/run.py
2023-09-06 15:34:50 +02:00

70 lines
1.7 KiB
Python

# copyright: Canonical
"Run the bench cases (remote to local)."
import json
import click
from benchmark import run_single_bench
from definitions import BENCH_DIR_NAMES, CEPH_ROOT, INST_STO_ROOT, REMOTE_INST_STO_ROOT, SERV_URL
from results_tools import Results
results = Results()
@click.group()
def cli():
pass
@cli.command()
def local():
click.echo("Running locally")
for runnum in range(50):
for files_type in BENCH_DIR_NAMES:
test_case = "Local-InsSto to CEPH"
source = f"{INST_STO_ROOT}/{files_type}"
target = CEPH_ROOT + files_type
run_single_bench(
runnum,
test_case,
files_type,
source,
target,
)
@cli.command()
def distant():
click.echo("Running distant to local")
for runnum in range(50):
for files_type in BENCH_DIR_NAMES:
test_case = "Distant-InsSto to InsSto"
source = f"{SERV_URL}/{REMOTE_INST_STO_ROOT}/{files_type}"
target = INST_STO_ROOT + files_type
run_single_bench(
runnum,
test_case,
files_type,
source,
target,
)
test_case = "Distant-InsSto to CEPH"
source = f"{SERV_URL}/{REMOTE_INST_STO_ROOT}/{files_type}"
target = CEPH_ROOT + files_type
run_single_bench(
runnum,
test_case,
files_type,
source,
target,
results,
)
if __name__ == "__main__":
cli()
json.dump(results.result_list, open("results.json", "w"))
results.save_to_csv()