Packagecom.gskinner.performance
Classpublic class AbstractTest
InheritanceAbstractTest Inheritance flash.events.EventDispatcher
SubclassesMethodTest, RenderTest

AbstractTest is a base class for building concrete test classes on. It should not be instantiated directly. It is possible to create new categories of tests by extending AbstractTest, but MethodTest and RenderTest should handle almost all requirements.



Public Properties
 PropertyDefined 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
Public Methods
 MethodDefined 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
Events
 EventSummaryDefined by
   Dispatched when the test completes.AbstractTest
Property detail
descriptionproperty
public var description:String

Optional description for this test.

deviationproperty 
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.

errorproperty 
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.

iterationsproperty 
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.

loopsproperty 
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.

maxproperty 
public var max:int = -1

The highest time for all iterations, or -1 if the test has not yet run successfully.

minproperty 
public var min:int = -1

The lowest time for all iterations, or -1 if the test has not yet run successfully.

nameproperty 
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.

timeproperty 
public var time:Number = -1

The average time for all iterations, or -1 if the test has not yet run successfully.

timeLogproperty 
public var timeLog:Array

An array of int values indicating the times for each iteration that was run.

Constructor detail
AbstractTest()constructor
public function AbstractTest(name:String = null, iterations:uint = 0, loops:uint = 1, description:String = null)

AbstractTest should not be instantiated directly.

Parameters
name:String (default = null)
 
iterations:uint (default = 0)
 
loops:uint (default = 1)
 
description:String (default = null)
Method detail
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.

Returns
int
toString()method 
public override function toString():String

Returns a string representation of this Test. Very handy for tracing:
trace(myTest);

Returns
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.

Returns
XML
Event detail
completeevent 
Event object type: flash.events.Event

Dispatched when the test completes. This is either when all iterations have been run, or when an error occurs.