Skip to content
Snippets Groups Projects
Commit cada16a6 authored by Florian Fischer's avatar Florian Fischer
Browse files

readd option to summarize after benchmark run

parent 31a14856
Branches
No related tags found
No related merge requests found
...@@ -34,6 +34,8 @@ from src.util import print_status, print_warn, print_error ...@@ -34,6 +34,8 @@ from src.util import print_status, print_warn, print_error
from src.util import print_info, print_info2, print_debug from src.util import print_info, print_info2, print_debug
from src.util import print_license_and_exit from src.util import print_license_and_exit
from summarize import summarize
def epilog(): def epilog():
"""Run tasks on exit""" """Run tasks on exit"""
...@@ -81,10 +83,7 @@ def main(): ...@@ -81,10 +83,7 @@ def main():
help="how often the benchmarks run", help="how often the benchmarks run",
default=3, default=3,
type=int) type=int)
parser.add_argument("-v", parser.add_argument("-v", "--verbose", help="more output", action='count')
"--verbose",
help="more output",
action='count')
parser.add_argument("-b", parser.add_argument("-b",
"--benchmarks", "--benchmarks",
help="benchmarks to run", help="benchmarks to run",
...@@ -103,6 +102,10 @@ def main(): ...@@ -103,6 +102,10 @@ def main():
"--resultdir", "--resultdir",
help="directory where all results go", help="directory where all results go",
type=str) type=str)
parser.add_argument("-s",
"--summarize",
help="create a summary of this run",
action='store_true')
parser.add_argument("--license", parser.add_argument("--license",
help="print license info and exit", help="print license info and exit",
action='store_true') action='store_true')
...@@ -256,6 +259,9 @@ def main(): ...@@ -256,6 +259,9 @@ def main():
print_status("Cleaning up", bench.name, "...") print_status("Cleaning up", bench.name, "...")
bench.cleanup() bench.cleanup()
if args.summarize:
summarize()
if __name__ == "__main__": if __name__ == "__main__":
main() main()
...@@ -90,41 +90,16 @@ def bench_sum(bench): ...@@ -90,41 +90,16 @@ def bench_sum(bench):
os.chdir("..") os.chdir("..")
def main(): def summarize(benchmarks=None, exclude_benchmarks=None):
if "--license" in sys.argv: """summarize the benchmarks in the resdir"""
print_license_and_exit()
if "--version" in sys.argv: cwd = os.getcwd()
print(src.facter.allocbench_version()) os.chdir(src.globalvars.resdir)
sys.exit(0)
parser = argparse.ArgumentParser(description="Summarize allocbench results in allocator sets")
parser.add_argument("results", help="path to results", type=str)
parser.add_argument("-t", "--file-ext", help="file extension used for plots", type=str)
parser.add_argument("--license", help="print license info and exit", action='store_true')
parser.add_argument("--version", help="print version info and exit", action='store_true')
parser.add_argument("-b", "--benchmarks", help="benchmarks to summarize", nargs='+')
parser.add_argument("-x", "--exclude-benchmarks", help="benchmarks to exclude", nargs='+')
args = parser.parse_args()
if not os.path.isdir(args.results):
print_error(f"{args.results} is no directory")
sys.exit(1)
if args.file_ext:
src.globalvars.summary_file_ext = args.file_ext
src.globalvars.resdir = args.results
os.chdir(args.results)
# Load facts
src.facter.load_facts()
for benchmark in src.globalvars.benchmarks: for benchmark in src.globalvars.benchmarks:
if args.benchmarks and not benchmark in args.benchmarks: if benchmarks and not benchmark in benchmarks:
continue continue
if args.exclude_benchmarks and benchmark in args.exclude_benchmarks: if exclude_benchmarks and benchmark in exclude_benchmarks:
continue continue
bench_module = importlib.import_module(f"src.benchmarks.{benchmark}") bench_module = importlib.import_module(f"src.benchmarks.{benchmark}")
...@@ -146,6 +121,36 @@ def main(): ...@@ -146,6 +121,36 @@ def main():
except FileExistsError as e: except FileExistsError as e:
print(e) print(e)
os.chdir(cwd)
if __name__ == "__main__": if __name__ == "__main__":
main() if "--license" in sys.argv:
print_license_and_exit()
if "--version" in sys.argv:
print(src.facter.allocbench_version())
sys.exit(0)
parser = argparse.ArgumentParser(description="Summarize allocbench results in allocator sets")
parser.add_argument("results", help="path to results", type=str)
parser.add_argument("-t", "--file-ext", help="file extension used for plots", type=str)
parser.add_argument("--license", help="print license info and exit", action='store_true')
parser.add_argument("--version", help="print version info and exit", action='store_true')
parser.add_argument("-b", "--benchmarks", help="benchmarks to summarize", nargs='+')
parser.add_argument("-x", "--exclude-benchmarks", help="benchmarks to exclude", nargs='+')
args = parser.parse_args()
if args.file_ext:
src.globalvars.summary_file_ext = args.file_ext
if not os.path.isdir(args.results):
print_error(f"{args.results} is no directory")
sys.exit(1)
src.globalvars.resdir = args.results
# Load facts
src.facter.load_facts(src.globalvars.resdir)
summarize(benchmarks=args.benchmarks, exclude_benchmarks=args.exclude_benchmarks)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment