Struct ProfilingState
- Namespace
- Stride.Core.Diagnostics
- Assembly
- Stride.Core.dll
A profiler state contains information of a portion of code being profiled. See remarks.
public struct ProfilingState : IDisposable
- Implements
- Inherited Members
- Extension Methods
Remarks
This struct is not intended to be used directly but only through Begin(ProfilingKey).
Properties
Attributes
A list of attributes (dimensions) associated with this profiling state.
public readonly TagList Attributes { get; }
Property Value
IsInitialized
Gets a value indicating whether this instance is initialized.
public readonly bool IsInitialized { get; }
Property Value
- bool
trueif this instance is initialized; otherwise,false.
ProfilingId
Gets the profiling unique identifier.
public readonly int ProfilingId { get; }
Property Value
- int
The profiling unique identifier.
ProfilingKey
Gets the profiling key.
public readonly ProfilingKey ProfilingKey { get; }
Property Value
- ProfilingKey
The profiling key.
TickFrequency
Gets or sets the TickFrequency used to convert long timestamp to TimeSpan. By default for CPU events it's Frequency and for GPU events it's set by the rendering code.
public long TickFrequency { get; set; }
Property Value
Methods
Begin()
Emits a Begin event. This method shouldn't be called if you used Begin(ProfilingKey) or Begin(ProfilingKey, string, ProfilingCustomValue?, ProfilingCustomValue?, ProfilingCustomValue?, ProfilingCustomValue?) to create this instance.
public void Begin()
Begin(string, ProfilingCustomValue?, ProfilingCustomValue?, ProfilingCustomValue?, ProfilingCustomValue?)
Emits a Begin event. This method shouldn't be called if you used Begin(ProfilingKey) or Begin(ProfilingKey, string, ProfilingCustomValue?, ProfilingCustomValue?, ProfilingCustomValue?, ProfilingCustomValue?) to create this instance.
public void Begin(string text, ProfilingCustomValue? value0 = null, ProfilingCustomValue? value1 = null, ProfilingCustomValue? value2 = null, ProfilingCustomValue? value3 = null)
Parameters
textstringA message to pass with the event.
value0ProfilingCustomValue?First optional value to pass with the event (can be int, float, long or double).
value1ProfilingCustomValue?Second optional value to pass with the event (can be int, float, long or double).
value2ProfilingCustomValue?Third optional value to pass with the event (can be int, float, long or double).
value3ProfilingCustomValue?Fourth optional value to pass with the event (can be int, float, long or double).
CheckIfEnabled()
Updates internal enabled state based on if the profile is marked as enabled in the profiler.
public void CheckIfEnabled()
Remarks
This can be used by long-running profiles that use markers, to ensure events start or stop emitting when the profile gets enabled or disabled at runtime.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
End()
Emits an End event.
public void End()
End(string, ProfilingCustomValue?, ProfilingCustomValue?, ProfilingCustomValue?, ProfilingCustomValue?)
Emits an End event.
public void End(string text, ProfilingCustomValue? value0 = null, ProfilingCustomValue? value1 = null, ProfilingCustomValue? value2 = null, ProfilingCustomValue? value3 = null)
Parameters
textstringA message to pass with the event.
value0ProfilingCustomValue?First optional value to pass with the event (can be int, float, long or double).
value1ProfilingCustomValue?Second optional value to pass with the event (can be int, float, long or double).
value2ProfilingCustomValue?Third optional value to pass with the event (can be int, float, long or double).
value3ProfilingCustomValue?Fourth optional value to pass with the event (can be int, float, long or double).
Mark()
Emits a Mark event.
public void Mark()
Remarks
Mark events can highlight when and how many times specific parts of your code have been called.
Mark(string, ProfilingCustomValue?, ProfilingCustomValue?, ProfilingCustomValue?, ProfilingCustomValue?)
Emits a Mark event.
public void Mark(string text, ProfilingCustomValue? value0 = null, ProfilingCustomValue? value1 = null, ProfilingCustomValue? value2 = null, ProfilingCustomValue? value3 = null)
Parameters
textstringA message to pass with the event.
value0ProfilingCustomValue?First optional value to pass with the event (can be int, float, long or double).
value1ProfilingCustomValue?Second optional value to pass with the event (can be int, float, long or double).
value2ProfilingCustomValue?Third optional value to pass with the event (can be int, float, long or double).
value3ProfilingCustomValue?Fourth optional value to pass with the event (can be int, float, long or double).
Remarks
Mark events can highlight when and how many times specific parts of your code have been called.