getGroups() public méthode

Whitelist of groups to execute.
public getGroups ( ) : string[]
Résultat string[]
Exemple #1
0
 /**
  * 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;
 }
Exemple #2
0
 /**
  * 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)
 {
     $executorConfig = $this->executorRegistry->getConfig($context->getExecutor());
     $executor = $this->executorRegistry->getService($executorConfig['executor']);
     $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));
     // add environmental information.
     $this->appendEnvironment($suiteEl);
     // build the collection of benchmarks to be executed.
     $collection = $this->collectionBuilder->buildCollection($context->getPath(), $context->getFilters(), $context->getGroups());
     // log the start of the suite run.
     $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($executor, $context, $benchmark, $benchmarkEl);
         $this->logger->benchmarkEnd($benchmark);
         $suiteEl->appendChild($benchmarkEl);
     }
     $this->logger->endSuite($dom);
     return $dom;
 }
Exemple #3
0
 /**
  * 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)
 {
     $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;
 }