PhpBench\Benchmark\RunnerContext::getGroups PHP Method

getGroups() public method

Whitelist of groups to execute.
public getGroups ( ) : string[]
return string[]
    public function getGroups()
    {
        return $this->options['groups'];
    }

Usage Example

示例#1
0
文件: Runner.php 项目: stof/phpbench
 /**
  * Run all benchmarks (or all applicable benchmarks) in the given path.
  *
  * The $name argument will set the "name" attribute on the "suite" element.
  *
  * @param string $contextName
  * @param string $path
  */
 public function run(RunnerContext $context)
 {
     $dom = new SuiteDocument();
     $rootEl = $dom->createElement('phpbench');
     $rootEl->setAttribute('version', PhpBench::VERSION);
     $dom->appendChild($rootEl);
     $suiteEl = $rootEl->appendElement('suite');
     $suiteEl->setAttribute('context', $context->getContextName());
     $suiteEl->setAttribute('date', date('c'));
     $suiteEl->setAttribute('config-path', $this->configPath);
     $suiteEl->setAttribute('retry-threshold', $context->getRetryThreshold($this->retryThreshold));
     $collection = $this->collectionBuilder->buildCollection($context->getPath(), $context->getFilters(), $context->getGroups());
     $this->logger->startSuite($dom);
     /* @var BenchmarkMetadata */
     foreach ($collection->getBenchmarks() as $benchmark) {
         $benchmarkEl = $dom->createElement('benchmark');
         $benchmarkEl->setAttribute('class', $benchmark->getClass());
         $this->logger->benchmarkStart($benchmark);
         $this->runBenchmark($context, $benchmark, $benchmarkEl);
         $this->logger->benchmarkEnd($benchmark);
         $suiteEl->appendChild($benchmarkEl);
     }
     $this->logger->endSuite($dom);
     return $dom;
 }
All Usage Examples Of PhpBench\Benchmark\RunnerContext::getGroups