docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class PerformanceTest

    Represents active performance test as a singleton.

    Inheritance
    object
    PerformanceTest
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    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
    object.ToString()

    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
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)