PHP Класс PhpBench\Model\Variant

TODO: Remove array access?
Наследование: implements IteratorAggregate, implements ArrayAccess, implements Countable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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