PHP Class PhpBench\Model\Variant

TODO: Remove array access?
Inheritance: implements IteratorAggregate, implements ArrayAccess, implements Countable
Afficher le fichier Open project: dantleech/phpbench Class Usage Examples

Méthodes publiques

Méthode Description
__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.

Method Details

__construct() public méthode

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

addIteration() public méthode

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

computeStats() public méthode

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 méthode

public count ( )

createErrorStack() public méthode

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

createIteration() public méthode

Create and add a new iteration.
public createIteration ( array $results = [] ) : Iteration
$results array
Résultat Iteration

getErrorStack() public méthode

Should be called when rebuiling the object graph.
public getErrorStack ( ) : ErrorStack
Résultat ErrorStack

getIteration() public méthode

Return the iteration at the given index.
public getIteration ( $index ) : Iteration
Résultat Iteration

getIterations() public méthode

Return all the iterations.
public getIterations ( ) : Iteration[]
Résultat Iteration[]

getIterator() public méthode

public getIterator ( )

getMetricValues() public méthode

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

getMetricValuesByRev() public méthode

Return the average metric values by revolution.
public getMetricValuesByRev ( $resultClass, $metric ) : mixed[]
Résultat mixed[]

getParameterSet() public méthode

Return the parameter set.
public getParameterSet ( ) : ParameterSet
Résultat ParameterSet

getRejectCount() public méthode

Return the number of rejected iterations.
public getRejectCount ( ) : integer
Résultat integer

getRejects() public méthode

Return all rejected iterations.
public getRejects ( ) : Iteration[]
Résultat Iteration[]

getRevolutions() public méthode

Return the number of revolutions for this variant.
public getRevolutions ( ) : integer
Résultat integer

getStats() public méthode

See self::$stats. TODO: Rename to getDistribution
public getStats ( ) : Distribution
Résultat PhpBench\Math\Distribution

getSubject() public méthode

Return the subject metadata.
public getSubject ( ) : Subject
Résultat Subject

getWarmup() public méthode

Return the number of warmup revolutions.
public getWarmup ( ) : integer
Résultat integer

hasErrorStack() public méthode

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

isComputed() public méthode

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

offsetExists() public méthode

public offsetExists ( $offset )

offsetGet() public méthode

public offsetGet ( $offset )

offsetSet() public méthode

public offsetSet ( $offset, $value )

offsetUnset() public méthode

public offsetUnset ( $offset )

setException() public méthode

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() public méthode

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