Class PooledProfilerScriptEvents

The PooledProfilerScriptEvents class is a central class in script domain that gathers data from profiling before moving them to native storage.

Hierarchy (view full)

Constructors

Properties

_attributeValues: ProfilerAttributeValue[]
_eventSamples: ProfilerEventSample[]
_frameIdentifier: number
_nextEventSampleIdentifier: number
_stopwatch: Stopwatch
_stopwatchProfilerOffsetNanoseconds: number

Add this to nanoseconds from _stopwatch to get profiler time specified by profiler runtime.

areStatsEnabledInScript: boolean

Enables recording of profiler stats in script events. This typically requires a script -> C++ interop call, which might affect pefromance, so it is disabled by default.

Collection of profiler stats that should be captured during profiling.

isProfilingEnabled: boolean

Runtime should continuously capture profiling data, but data older than last frame can be automatically removed.

_attributes: ProfilerAttribute[]
_events: ProfilerEvent[]
_nextAttributeIdentifier: number
_nextEventIdentifier: number

Pointer to a singleton instance of profiler script events.

Methods

  • Submits attribute definition into profiler runtime database. Can be called only during profiler data synchronization.

    Parameters

    • identifier: number

      Unique identifier of the attribute definition.

    • name: string

      User-friendly name for the attribute.

    Returns void

  • If the attribute value is active, this will synchronize it into profiler runtime database at the end of frame. Both active and inactive attribute value instances will be returned into attribute value instance pool after synchronizations.

    Parameters

    Returns void

  • Submits recorded attribute values into profiler runtime database. These will be assigned to the correct event samples. Can be called only during profiler data synchronization.

    Parameters

    Returns void

  • Submits event definition into profiler runtime database. Can be called only during profiler data synchronization.

    Parameters

    • identifier: number

      Unique identifier of the event definition.

    • name: string

      User-friendly name for the event.

    Returns void

  • If the event sample is active, this will synchronize it into profiler runtime database at the end of frame. Both active and inactive event sample instances will be returned into event sample instance pool after synchronizations.

    Parameters

    Returns void

  • Submits recorded event samples into profiler runtime database. Can be called only during profiler data synchronization.

    Parameters

    Returns void

  • Returns identifier of the current frame according to profiler runtime.

    Returns number

    Current frame identifier.

  • Returns identifier to be associated with new event sample.

    Returns number

    New event sample identifier.

  • Returns best estimate for current time defined by profiler runtime.

    Returns number

    Current profiler time to be used by sample measurements.

  • Returns identifier that was assigned to ProfielrScriptEvents profiler provider when it was registered in ProfilerRuntime.

    Returns number

    The provider identifier.

  • Registers the provider with the profiler runtime.

    Returns boolean

    False if the registration failed.

  • Called from native code to inform provider about new frame being started and to update profiling configuration.

    Parameters

    • frameIdentifier: number

      Identifier to be used for following frame.

    Returns void

  • Unregisters the provider with the profiler runtime.

    Returns boolean

    False if the unregistration failed.

  • Adds attribute definition to be synchronized into profiler runtime at the end of frame.

    Parameters

    Returns void

  • Adds event definition to be synchronized into profiler runtime at the end of frame.

    Parameters

    • profilerEvent: ProfilerEvent

      New profiler event to be added to database.

    Returns void

  • Returns identifier to be associated with new attribute definition.

    Returns number

    New attribute identifier.

  • Returns identifier to be associated with new event definition.

    Returns number

    New event identifier.

  • Sets singleton instance of profiler script events. This should be called only once after module reload.

    Parameters

    Returns void