docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class PerfStatsManager

    Singleton manager that drives all registered CollectorBase instances, ticking their events each frame and dispatching aggregated ProfilerReport objects on the configured period.

    Inheritance
    object
    PerfStatsManager
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.SimulationPro
    Assembly: Unity.SimulationPro.Capture.dll
    Syntax
    public class PerfStatsManager

    Fields

    DEFAULT_ERROR_SAMPLE_VALUE

    The DEFAULT ERROR SAMPLE VALUE.

    Declaration
    public double DEFAULT_ERROR_SAMPLE_VALUE
    Field Value
    Type Description
    double

    realTimeSinceStartUp

    The realTimeSinceStartUp.

    Declaration
    public float realTimeSinceStartUp
    Field Value
    Type Description
    float

    Properties

    Instance

    PerfStatsManager singleton instance to that can enable Start/Stop invoking the collectors.

    Declaration
    public static PerfStatsManager Instance { get; }
    Property Value
    Type Description
    PerfStatsManager

    Methods

    BeginSample(string, Type)

    Begin sample for the provided event.

    Declaration
    public void BeginSample(string eventName, Type associatedCollectorType)
    Parameters
    Type Name Description
    string eventName

    The name of the profiling event to begin sampling.

    Type associatedCollectorType

    The collector type that owns the ProfilerSamplingEvent to sample.

    DispatchCollectors(bool)

    Invoke this function to flush all the events on all the collectors. This will invoke dispatcher on all the collectors. This call can be slow depending upon the dispatcher implementation.

    Declaration
    public void DispatchCollectors(bool shuttingDown = false)
    Parameters
    Type Name Description
    bool shuttingDown

    When true, forces all collectors to dispatch regardless of their period.

    EndSample(string, Type)

    End Sample for the provided event.

    Declaration
    public void EndSample(string eventName, Type associatedCollectorType)
    Parameters
    Type Name Description
    string eventName

    The name of the profiling event to end sampling.

    Type associatedCollectorType

    The collector type that owns the ProfilerSamplingEvent to end.

    SetGlobalDispatchers(List<IGlobalProfilerDataDispatcher>)

    Sets the dispatchers that receive collected global profiler data.

    Declaration
    public void SetGlobalDispatchers(List<IGlobalProfilerDataDispatcher> dispatchers)
    Parameters
    Type Name Description
    List<IGlobalProfilerDataDispatcher> dispatchers

    The dispatchers to send global profiler data to.

    StartProfiling(List<CollectorBase>)

    Invoke this method to start profiling by invoking/activating collectors.

    Declaration
    public void StartProfiling(List<CollectorBase> collectors)
    Parameters
    Type Name Description
    List<CollectorBase> collectors

    Array of data collectors attached to the profiler.

    StopProfiling()

    Inovke this method to stop profiling.

    Declaration
    public void StopProfiling()

    TrackAPIUsage(string, Type)

    Track API usage for the provided function.

    Declaration
    public void TrackAPIUsage(string functionName, Type associatedColletorType)
    Parameters
    Type Name Description
    string functionName

    The name of the function whose invocation count should be tracked.

    Type associatedColletorType

    The collector type that owns the CounterEvent to increment.

    In This Article
    Back to top
    Copyright © 2026 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)