PHP 클래스 PhpBench\Model\Variant

TODO: Remove array access?
상속: implements IteratorAggregate, implements ArrayAccess, implements Countable
파일 보기 프로젝트 열기: dantleech/phpbench 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Subject $subject, ParameterSet $parameterSet, $revolutions, $warmup, array $computedStats = [] )
addIteration ( Iteration $iteration ) Add an iteration.
computeStats ( ) Calculate and set the deviation from the mean time for each iteration. If the deviation is greater than the rejection threshold, then mark the iteration as rejected.
count ( ) Return number of iterations.
createErrorStack ( array $errors ) Create and set the error stack from a list of Error instances.
createIteration ( array $results = [] ) : Iteration Create and add a new iteration.
getErrorStack ( ) : ErrorStack Should be called when rebuiling the object graph.
getIteration ( $index ) : Iteration Return the iteration at the given index.
getIterations ( ) : Iteration[] Return all the iterations.
getIterator ( )
getMetricValues ( $resultClass, $metricName ) : mixed[] Return result values by class and metric name.
getMetricValuesByRev ( $resultClass, $metric ) : mixed[] Return the average metric values by revolution.
getParameterSet ( ) : ParameterSet Return the parameter set.
getRejectCount ( ) : integer Return the number of rejected iterations.
getRejects ( ) : Iteration[] Return all rejected iterations.
getRevolutions ( ) : integer Return the number of revolutions for this variant.
getStats ( ) : Distribution Return statistics about this iteration collection.
getSubject ( ) : Subject Return the subject metadata.
getWarmup ( ) : integer Return the number of warmup revolutions.
hasErrorStack ( ) : boolean Return true if any of the iterations in this set encountered an error.
isComputed ( ) : boolean Return true if the collection has been computed (i.e. stats have been s set and rejects identified).
offsetExists ( $offset )
offsetGet ( $offset )
offsetSet ( $offset, $value )
offsetUnset ( $offset )
setException ( Exception $exception ) Create an error stack from an Exception.
spawnIterations ( integer $nbIterations ) Generate $nbIterations and add them to the variant.

메소드 상세

__construct() 공개 메소드

public __construct ( Subject $subject, ParameterSet $parameterSet, $revolutions, $warmup, array $computedStats = [] )
$subject Subject
$parameterSet ParameterSet
$computedStats array

addIteration() 공개 메소드

Add an iteration.
public addIteration ( Iteration $iteration )
$iteration Iteration

computeStats() 공개 메소드

Calculate and set the deviation from the mean time for each iteration. If the deviation is greater than the rejection threshold, then mark the iteration as rejected.
public computeStats ( )

count() 공개 메소드

public count ( )

createErrorStack() 공개 메소드

Create and set the error stack from a list of Error instances.
public createErrorStack ( array $errors )
$errors array

createIteration() 공개 메소드

Create and add a new iteration.
public createIteration ( array $results = [] ) : Iteration
$results array
리턴 Iteration

getErrorStack() 공개 메소드

Should be called when rebuiling the object graph.
public getErrorStack ( ) : ErrorStack
리턴 ErrorStack

getIteration() 공개 메소드

Return the iteration at the given index.
public getIteration ( $index ) : Iteration
리턴 Iteration

getIterations() 공개 메소드

Return all the iterations.
public getIterations ( ) : Iteration[]
리턴 Iteration[]

getIterator() 공개 메소드

public getIterator ( )

getMetricValues() 공개 메소드

e.g. $variant->getMetricValues(ComputedResult::class, 'z_value');
public getMetricValues ( $resultClass, $metricName ) : mixed[]
리턴 mixed[]

getMetricValuesByRev() 공개 메소드

Return the average metric values by revolution.
public getMetricValuesByRev ( $resultClass, $metric ) : mixed[]
리턴 mixed[]

getParameterSet() 공개 메소드

Return the parameter set.
public getParameterSet ( ) : ParameterSet
리턴 ParameterSet

getRejectCount() 공개 메소드

Return the number of rejected iterations.
public getRejectCount ( ) : integer
리턴 integer

getRejects() 공개 메소드

Return all rejected iterations.
public getRejects ( ) : Iteration[]
리턴 Iteration[]

getRevolutions() 공개 메소드

Return the number of revolutions for this variant.
public getRevolutions ( ) : integer
리턴 integer

getStats() 공개 메소드

See self::$stats. TODO: Rename to getDistribution
public getStats ( ) : Distribution
리턴 PhpBench\Math\Distribution

getSubject() 공개 메소드

Return the subject metadata.
public getSubject ( ) : Subject
리턴 Subject

getWarmup() 공개 메소드

Return the number of warmup revolutions.
public getWarmup ( ) : integer
리턴 integer

hasErrorStack() 공개 메소드

Return true if any of the iterations in this set encountered an error.
public hasErrorStack ( ) : boolean
리턴 boolean

isComputed() 공개 메소드

Return true if the collection has been computed (i.e. stats have been s set and rejects identified).
public isComputed ( ) : boolean
리턴 boolean

offsetExists() 공개 메소드

public offsetExists ( $offset )

offsetGet() 공개 메소드

public offsetGet ( $offset )

offsetSet() 공개 메소드

public offsetSet ( $offset, $value )

offsetUnset() 공개 메소드

public offsetUnset ( $offset )

setException() 공개 메소드

Should be called when an Exception is encountered during the execution of any of the iteration processes. After an exception is encountered the results from this iteration set are invalid.
public setException ( Exception $exception )
$exception Exception

spawnIterations() 공개 메소드

Generate $nbIterations and add them to the variant.
public spawnIterations ( integer $nbIterations )
$nbIterations integer