setOutputTimeUnit() public method

public setOutputTimeUnit ( $outputTimeUnit )
Example #1
0
 public function createSubjectFromMetadata(SubjectMetadata $metadata)
 {
     $subject = new Subject($this, $metadata->getName());
     $subject->setGroups($metadata->getGroups());
     $subject->setSleep($metadata->getSleep());
     $subject->setRetryThreshold($metadata->getRetryThreshold());
     $subject->setOutputTimeUnit($metadata->getOutputTimeUnit());
     $subject->setOutputTimePrecision($metadata->getOutputTimePrecision());
     $subject->setOutputMode($metadata->getOutputMode());
     $this->subjects[] = $subject;
     return $subject;
 }
Example #2
0
 private function processSubject(Subject $subject, \DOMElement $subjectEl, array $resultClasses)
 {
     $groups = [];
     foreach ($subjectEl->query('./group') as $groupEl) {
         $groups[] = $groupEl->getAttribute('name');
     }
     $subject->setGroups($groups);
     // TODO: These attributes should be on the subject, see
     // https://github.com/phpbench/phpbench/issues/307
     foreach ($subjectEl->query('./variant') as $variantEl) {
         $subject->setSleep($variantEl->getAttribute('sleep'));
         $subject->setOutputTimeUnit($variantEl->getAttribute('output-time-unit'));
         $subject->setOutputTimePrecision($variantEl->getAttribute('output-time-precision'));
         $subject->setOutputMode($variantEl->getAttribute('output-mode'));
         $subject->setRetryThreshold($variantEl->getAttribute('retry-threshold'));
         break;
     }
     foreach ($subjectEl->query('./variant') as $index => $variantEl) {
         $parameters = $this->getParameters($variantEl);
         $parameterSet = new ParameterSet($index, $parameters);
         $stats = $this->getComputedStats($variantEl);
         $variant = $subject->createVariant($parameterSet, $variantEl->getAttribute('revs'), $variantEl->getAttribute('warmup'), $stats);
         $this->processVariant($variant, $variantEl, $resultClasses);
     }
 }