Package | com.gskinner.performance |
Class | public class AbstractTest |
Inheritance | AbstractTest ![]() |
Subclasses | MethodTest, RenderTest |
Property | Defined by | ||
---|---|---|---|
description : String Optional description for this test.
| AbstractTest | ||
deviation : Number = 0
Provides a rough indication of how much the results of different iterations varied from the norm as a fraction of the average time.
| AbstractTest | ||
error : Error
If an error occurs in any iteration of the test, the error property will contain the resulting Error object.
| AbstractTest | ||
iterations : uint
The number of iterations to run with this test.
| AbstractTest | ||
loops : uint
Specifies how many times to repeat the test within a single iteration.
| AbstractTest | ||
max : int = -1 The highest time for all iterations, or -1 if the test has not yet run successfully.
| AbstractTest | ||
min : int = -1 The lowest time for all iterations, or -1 if the test has not yet run successfully.
| AbstractTest | ||
name : String
Optional name for this test.
| AbstractTest | ||
time : Number = -1 The average time for all iterations, or -1 if the test has not yet run successfully.
| AbstractTest | ||
timeLog : Array
An array of int values indicating the times for each iteration that was run.
| AbstractTest |
Method | Defined by | ||
---|---|---|---|
AbstractTest(name:String = null, iterations:uint = 0, loops:uint = 1, description:String = null)
AbstractTest should not be instantiated directly.
| AbstractTest | ||
complete():void
PerformanceTest calls
complete() when all of the iterations of the test have been run. | AbstractTest | ||
run():int
PerformanceTest calls
run() on tests to run and time them. | AbstractTest | ||
toString():String
Returns a string representation of this Test.
| AbstractTest | ||
toXML():XML
Returns XML containing all of the information about this test.
| AbstractTest |
Event | Summary | Defined by | ||
---|---|---|---|---|
Dispatched when the test completes. | AbstractTest |
description | property |
public var description:String
Optional description for this test.
deviation | property |
public var deviation:Number = 0
Provides a rough indication of how much the results of different iterations varied from the norm as a fraction of the average time. This is not standard deviation. This is calculated as (max-min)/time. It will always be 0 if only one iteration is run.
error | property |
public var error:Error
If an error occurs in any iteration of the test, the error property will contain the resulting Error object. If no error occurs, it will be null.
iterations | property |
public var iterations:uint
The number of iterations to run with this test. Each iteration is run and timed independently.
A larger number of iterations provides a larger sample, and more accurate results. Each iteration
should run long enough to yield a significant result (ex. >10ms).
Setting this to 0 indicates that PerformanceTest should use the default iterations. When the test
is run, this will be set to the iterations value of the TestSuite, or to 1.
loops | property |
public var loops:uint
Specifies how many times to repeat the test within a single iteration. This allows you to increase the significance of your results, but also introduces some overhead time related to calling the method multiple times. It can be handy for comparative testing though.
max | property |
public var max:int = -1
The highest time for all iterations, or -1 if the test has not yet run successfully.
min | property |
public var min:int = -1
The lowest time for all iterations, or -1 if the test has not yet run successfully.
name | property |
public var name:String
Optional name for this test. This is used for display purposes, and could also be used to uniquely identify the test for analytics systems.
time | property |
public var time:Number = -1
The average time for all iterations, or -1 if the test has not yet run successfully.
timeLog | property |
public var timeLog:Array
An array of int values indicating the times for each iteration that was run.
AbstractTest | () | constructor |
public function AbstractTest(name:String = null, iterations:uint = 0, loops:uint = 1, description:String = null)
AbstractTest should not be instantiated directly.
Parametersname:String (default = null )
|
|
iterations:uint (default = 0 )
|
|
loops:uint (default = 1 )
|
|
description:String (default = null )
|
complete | () | method |
public function complete():void
PerformanceTest calls complete()
when all of the iterations of the test have been run. This causes
the test to dispatch the COMPLETE event. You would not generally call this method directly.
run | () | method |
public function run():int
PerformanceTest calls run()
on tests to run and time them. The run() method returns the
time for that iteration, or -1 if an error occurred. You would not generally call the run()
method directly.
int |
toString | () | method |
public override function toString():String
Returns a string representation of this Test. Very handy for tracing:
trace(myTest);
String |
toXML | () | method |
public function toXML():XML
Returns XML containing all of the information about this test.
This is very useful for building analysis tools, and for saving out results to compare them in the future.
I might document the format some day, but for now it's simple enough to just trace the output of this function
to see it.
XML |
complete | event |
flash.events.Event
Dispatched when the test completes. This is either when all iterations have been run, or when an error occurs.