MCPcopy Index your code
hub / github.com/aws/aws-cli / run_benchmarks

Method run_benchmarks

scripts/performance/benchmark_utils.py:485–521  ·  view source on GitHub ↗

Orchestrates benchmarking via the supplied list of performance test cases.

(self, cases, args)

Source from the content-addressed store, hash-verified

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 """

Callers 1

run_benchmark_suiteMethod · 0.95

Calls 8

ProcessBenchmarkerClass · 0.85
existsMethod · 0.80
add_execution_resultsMethod · 0.80
get_processed_resultsMethod · 0.80
rmtreeMethod · 0.45
makedirsMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected