Package | com.gskinner.performance |
Class | public class MethodTest |
Inheritance | MethodTest ![]() ![]() |
loops
).
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 | |
memory : int
The average increase in System.totalMemory (in kb), that occured while running the test.
| MethodTest | ||
memoryLog : Array
An array of int values indicating the memory values for each iteration that was run.
| MethodTest | ||
method : Function The function / method to execute.
| MethodTest | ||
![]() | 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 | |
params : Array An array of parameters (if any) to call the method with.
| MethodTest | ||
retainedMemory : int
The average increase in System.totalMemory (in kb), that was not recovered after running the test.
| MethodTest | ||
retainedMemoryLog : Array
An array of int values indicating the retainedMemory values for each iteration that was run.
| MethodTest | ||
![]() | 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 | ||
---|---|---|---|
MethodTest(method:Function, params:Array = null, name:String = null, iterations:uint = 0, loops:uint = 1, description:String = null)
Creates a new instance of Test.
| MethodTest | ||
![]() |
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. | MethodTest | ||
toString():String
Returns a string representation of this Test.
| MethodTest | ||
toXML():XML
Returns XML containing all of the information about this test.
| MethodTest |
memory | property |
public var memory:int
The average increase in System.totalMemory (in kb), that occured while running the test.
Note that System.totalMemory allocated memory for the Flash player process. This means that
small increases in memory use may not be measured (because an additional block of memory was not allocated).
When examining memory usage, it is often worthwhile to use the toXML method to view the output from each
iteration separately. You will often see different memory characteristics on the first iteration than
subsequent runs.
memoryLog | property |
public var memoryLog:Array
An array of int values indicating the memory values for each iteration that was run.
method | property |
public var method:Function
The function / method to execute.
params | property |
public var params:Array
An array of parameters (if any) to call the method with.
retainedMemory | property |
public var retainedMemory:int
The average increase in System.totalMemory (in kb), that was not recovered after running the test.
Note that System.totalMemory allocated memory for the Flash player process. This means that
small increases in memory use may not be measured (because an additional block of memory was not allocated).
Flash player also may not deallocate memory immediately, causing innacurate results.
When examining memory usage, it is often worthwhile to use the toXML method to view the output from each
iteration separately. You will often see different memory characteristics on the first iteration than
subsequent runs.
retainedMemoryLog | property |
public var retainedMemoryLog:Array
An array of int values indicating the retainedMemory values for each iteration that was run.
MethodTest | () | constructor |
public function MethodTest(method:Function, params:Array = null, name:String = null, iterations:uint = 0, loops:uint = 1, description:String = null)
Creates a new instance of Test. See properties for parameter information.
Parametersmethod:Function |
|
params:Array (default = null )
|
|
name:String (default = null )
|
|
iterations:uint (default = 0 )
|
|
loops:uint (default = 1 )
|
|
description:String (default = null )
|
run | () | method |
public override 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 override 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 |