PhpBench\Benchmark\Runner::run PHP Метод

run() публичный Метод

The $name argument will set the "name" attribute on the "suite" element.
public run ( RunnerContext $context )
$context RunnerContext
    public function run(RunnerContext $context)
    {
        $executorConfig = $this->executorRegistry->getConfig($context->getExecutor());
        $executor = $this->executorRegistry->getService($executorConfig['executor']);
        // build the collection of benchmarks to be executed.
        $benchmarkMetadatas = $this->benchmarkFinder->findBenchmarks($context->getPath(), $context->getFilters(), $context->getGroups());
        $suite = new Suite($context->getContextName(), new \DateTime(), $this->configPath);
        $suite->setEnvInformations((array) $this->envSupplier->getInformations());
        // log the start of the suite run.
        $this->logger->startSuite($suite);
        try {
            /* @var BenchmarkMetadata */
            foreach ($benchmarkMetadatas as $benchmarkMetadata) {
                $benchmark = $suite->createBenchmark($benchmarkMetadata->getClass());
                $this->runBenchmark($executor, $context, $benchmark, $benchmarkMetadata);
            }
        } catch (StopOnErrorException $e) {
        }
        $suite->generateUuid();
        $this->logger->endSuite($suite);
        return $suite;
    }