Initialize benchmarks.
(self, benchmark_names: Optional[List[str]] = None)
| 25 | self._registered_benchmarks: Dict[str, BenchmarkConfig] = {} |
| 26 | |
| 27 | async def initialize(self, benchmark_names: Optional[List[str]] = None): |
| 28 | """Initialize benchmarks.""" |
| 29 | self.base_dir = assemble_project_path(os.path.join(config.workdir, "benchmark")) |
| 30 | os.makedirs(self.base_dir, exist_ok=True) |
| 31 | self.save_path = os.path.join(self.base_dir, "benchmark.json") |
| 32 | self.contract_path = os.path.join(self.base_dir, "contract.md") |
| 33 | |
| 34 | self.benchmark_context_manager = BenchmarkContextManager( |
| 35 | base_dir=self.base_dir, |
| 36 | save_path=self.save_path, |
| 37 | contract_path=self.contract_path |
| 38 | ) |
| 39 | await self.benchmark_context_manager.initialize(benchmark_names=benchmark_names) |
| 40 | logger.info("| ✅ Benchmark systems initialization completed") |
| 41 | |
| 42 | async def register(self, |
| 43 | benchmark: Union[Benchmark, Type[Benchmark]], |
nothing calls this directly
no test coverage detected