Class PerformanceTest
Represents active performance test as a singleton.
Inherited Members
Namespace: Unity.PerformanceTesting
Assembly: Unity.PerformanceTesting.dll
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
An action to be invoked when a performance test has finished execution.
Declaration
public static event Action OnTestEnded
Event Type
| Type | Description |
|---|---|
| Action |