moved all files to subproject
This commit is contained in:
76
ceph_bench/run.py
Normal file
76
ceph_bench/run.py
Normal file
@@ -0,0 +1,76 @@
|
||||
# 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,
|
||||
NUM_RUNS,
|
||||
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(NUM_RUNS):
|
||||
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(NUM_RUNS):
|
||||
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()
|
||||
Reference in New Issue
Block a user