Orchestrates benchmarking via the supplied list of performance test cases.
(self, cases, args)
| 483 | return [suite() for suite in BenchmarkHarness.BENCHMARK_SUITES] |
| 484 | |
| 485 | def run_benchmarks(self, cases, args): |
| 486 | """ |
| 487 | Orchestrates benchmarking via the supplied list of performance test |
| 488 | cases. |
| 489 | """ |
| 490 | summaries = {'results': []} |
| 491 | result_dir = args.result_dir |
| 492 | process_benchmarker = ProcessBenchmarker() |
| 493 | |
| 494 | if os.path.exists(result_dir): |
| 495 | shutil.rmtree(result_dir) |
| 496 | os.makedirs(result_dir, 0o777) |
| 497 | try: |
| 498 | for suite, case in cases: |
| 499 | for idx in range(args.num_iterations): |
| 500 | for cmd in case: |
| 501 | samples, execution_results = ( |
| 502 | self._run_isolated_benchmark( |
| 503 | result_dir, |
| 504 | idx, |
| 505 | cmd, |
| 506 | suite, |
| 507 | process_benchmarker, |
| 508 | args, |
| 509 | ) |
| 510 | ) |
| 511 | self._results_processor.add_execution_results( |
| 512 | cmd, samples, execution_results |
| 513 | ) |
| 514 | summaries['results'].extend( |
| 515 | self._results_processor.get_processed_results() |
| 516 | ) |
| 517 | self._results_processor.reset() |
| 518 | finally: |
| 519 | # final cleanup |
| 520 | shutil.rmtree(result_dir, ignore_errors=True) |
| 521 | print(json.dumps(summaries, indent=2)) |
| 522 | |
| 523 | def run_benchmark_suite(self, suite: BaseBenchmarkSuite, args): |
| 524 | """ |
no test coverage detected