Class PerformanceTest
Represents active performance test as a singleton.
Inherited Members
Namespace: Unity.PerformanceTesting
Syntax
[Serializable]
public class PerformanceTest
Constructors
PerformanceTest()
Initializes a new performance test and assigns it as singleton.
Declaration
public PerformanceTest()
Fields
Categories
List of categories assigned to the test.
Declaration
public List<string> Categories
Field Value
Type | Description |
---|---|
List<String> |
ClassName
Class name of the test.
Declaration
public string ClassName
Field Value
Type | Description |
---|---|
String |
MethodName
Method name of the test.
Declaration
public string MethodName
Field Value
Type | Description |
---|---|
String |
Name
Full name of the test.
Declaration
public string Name
Field Value
Type | Description |
---|---|
String |
SampleGroups
List of sample groups assigned to the test.
Declaration
public List<SampleGroup> SampleGroups
Field Value
Type | Description |
---|---|
List<SampleGroup> |
Version
Version of the test. Default "1".
Declaration
public string Version
Field Value
Type | Description |
---|---|
String |
Properties
Active
Singleton instance of active performance test.
Declaration
public static PerformanceTest Active { get; set; }
Property Value
Type | Description |
---|---|
PerformanceTest |
Methods
AddSampleGroup(SampleGroup)
Adds sample group to active performance test.
Declaration
public static void AddSampleGroup(SampleGroup sampleGroup)
Parameters
Type | Name | Description |
---|---|---|
SampleGroup | sampleGroup | Sample group to be added. |
CalculateStatisticalValues()
Loops through sample groups and updates statistical values.
Declaration
public void CalculateStatisticalValues()
GetSampleGroup(String)
Retrieves named sample group from active performance test.
Declaration
public static SampleGroup GetSampleGroup(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of sample group to retrieve. |
Returns
Type | Description |
---|---|
SampleGroup | Selected sample group. |
Exceptions
Type | Condition |
---|---|
PerformanceTestException | Exception will be thrown if there is no active performance test. |
ToString()
Returns performance test in a readable format.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | Readable representation of performance test. |
Overrides
Events
OnTestEnded
Declaration
public static event Action OnTestEnded
Event Type
Type | Description |
---|---|
Action |