ProfilingState Struct
Namespace: Stride.Core.DiagnosticsAssembly: Stride.Core.dll
A profiler state contains information of a portion of code being profiled. See remarks.
public struct ProfilingState : IDisposable
Remarks
This struct is not intended to be used directly but only through
Name | Description | |
---|---|---|
Properties | ||
DisposeDelegate | Gets or sets the dispose profile delegate. |
|
IsInitialized | Gets a value indicating whether this instance is initialized. |
|
ProfilingId | Gets the profiling unique identifier. |
|
ProfilingKey | Gets the profiling key. |
|
Methods | ||
Begin(Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>) | Emits a Begin event with the specified formatted text. |
|
Begin(String) | Emits a Begin profiling event with the specified text. |
|
Begin(String, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>) | Emits a Begin event with the specified formatted text. |
|
Begin(String, Object[]) | Emits a Begin profiling event with the specified formatted text. |
|
CheckIfEnabled() | Checks if the profiling key is enabled and update this instance. See remarks. |
|
Dispose() | ||
End() | Emits a End profiling event. |
|
End(Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>) | Emits a End profiling event with the specified custom value. |
|
End(String) | Emits a End profiling event with the specified text. |
|
End(String, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>) | Emits a End profiling event with the specified custom value. |
|
End(String, Object[]) | Emits a End profiling event with the specified formatted text. |
|
GetAttribute(String) | Gets the attribute value. |
|
Mark() | Emits a Mark event. |
|
Mark(Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>) | Emits a Mark profiling event with the specified text. |
|
Mark(String) | Emits a Mark event with the specified text. |
|
Mark(String, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>) | Emits a Mark profiling event with the specified text. |
|
Mark(String, Object[]) | Emits a Mark event with the specified formatted text. |
|
SetAttribute(String, Object) | Sets the attribute value for a specified key. See remarks. |
Properties
DisposeDelegate
Gets or sets the dispose profile delegate.
public ProfilerDisposeEventDelegate DisposeDelegate { get; set; }
Property Value
Type | Description |
---|---|
ProfilerDisposeEventDelegate | The dispose profile delegate. |
IsInitialized
Gets a value indicating whether this instance is initialized.
public readonly bool IsInitialized { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
ProfilingId
Gets the profiling unique identifier.
public readonly int ProfilingId { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The profiling unique identifier. |
ProfilingKey
Gets the profiling key.
public readonly ProfilingKey ProfilingKey { get; }
Property Value
Type | Description |
---|---|
ProfilingKey | The profiling key. |
Methods
Begin(Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>)
Emits a Begin event with the specified formatted text.
public void Begin(ProfilingCustomValue? value0, ProfilingCustomValue? value1 = null, ProfilingCustomValue? value2 = null, ProfilingCustomValue? value3 = null)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<ProfilingCustomValue> | value0 | First value (can be int, float, long or double). |
System.Nullable<ProfilingCustomValue> | value1 | Second value (can be int, float, long or double). |
System.Nullable<ProfilingCustomValue> | value2 | Third value (can be int, float, long or double). |
System.Nullable<ProfilingCustomValue> | value3 | Fourth value (can be int, float, long or double). |
Begin(String)
Emits a Begin profiling event with the specified text.
public void Begin(string text = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The text. |
Begin(String, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>)
Emits a Begin event with the specified formatted text.
public void Begin(string text, ProfilingCustomValue? value0, ProfilingCustomValue? value1 = null, ProfilingCustomValue? value2 = null, ProfilingCustomValue? value3 = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The event text. |
System.Nullable<ProfilingCustomValue> | value0 | First value (can be int, float, long or double). |
System.Nullable<ProfilingCustomValue> | value1 | Second value (can be int, float, long or double). |
System.Nullable<ProfilingCustomValue> | value2 | Third value (can be int, float, long or double). |
System.Nullable<ProfilingCustomValue> | value3 | Fourth value (can be int, float, long or double). |
Begin(String, Object[])
Emits a Begin profiling event with the specified formatted text.
public void Begin(string textFormat, params object[] textFormatArguments)
Parameters
Type | Name | Description |
---|---|---|
System.String | textFormat | The text format. |
System.Object[] | textFormatArguments | The text format arguments. |
CheckIfEnabled()
Checks if the profiling key is enabled and update this instance. See remarks.
public void CheckIfEnabled()
Remarks
This can be used for long running profiling that are using markers and want to log markers if the profiling was activated at runtime.
Dispose()
public void Dispose()
End()
Emits a End profiling event.
public void End()
End(Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>)
Emits a End profiling event with the specified custom value.
public void End(ProfilingCustomValue? value0, ProfilingCustomValue? value1 = null, ProfilingCustomValue? value2 = null, ProfilingCustomValue? value3 = null)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<ProfilingCustomValue> | value0 | First value (can be int, float, long or double). |
System.Nullable<ProfilingCustomValue> | value1 | Second value (can be int, float, long or double). |
System.Nullable<ProfilingCustomValue> | value2 | Third value (can be int, float, long or double). |
System.Nullable<ProfilingCustomValue> | value3 | Fourth value (can be int, float, long or double). |
End(String)
Emits a End profiling event with the specified text.
public void End(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The text. |
End(String, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>)
Emits a End profiling event with the specified custom value.
public void End(string text, ProfilingCustomValue? value0, ProfilingCustomValue? value1 = null, ProfilingCustomValue? value2 = null, ProfilingCustomValue? value3 = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The event text. |
System.Nullable<ProfilingCustomValue> | value0 | First value (can be int, float, long or double). |
System.Nullable<ProfilingCustomValue> | value1 | Second value (can be int, float, long or double). |
System.Nullable<ProfilingCustomValue> | value2 | Third value (can be int, float, long or double). |
System.Nullable<ProfilingCustomValue> | value3 | Fourth value (can be int, float, long or double). |
End(String, Object[])
Emits a End profiling event with the specified formatted text.
public void End(string textFormat, params object[] textFormatArguments)
Parameters
Type | Name | Description |
---|---|---|
System.String | textFormat | The text format. |
System.Object[] | textFormatArguments | The text format arguments. |
GetAttribute(String)
Gets the attribute value.
public object GetAttribute(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Object | Value of a key. |
Remarks
If profiling was not enabled for this profile key, the attribute is not stored
Mark()
Emits a Mark event.
public void Mark()
Mark(Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>)
Emits a Mark profiling event with the specified text.
public void Mark(ProfilingCustomValue? value0, ProfilingCustomValue? value1 = null, ProfilingCustomValue? value2 = null, ProfilingCustomValue? value3 = null)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<ProfilingCustomValue> | value0 | First value (can be int, float, long or double). |
System.Nullable<ProfilingCustomValue> | value1 | Second value (can be int, float, long or double). |
System.Nullable<ProfilingCustomValue> | value2 | Third value (can be int, float, long or double). |
System.Nullable<ProfilingCustomValue> | value3 | Fourth value (can be int, float, long or double). |
Mark(String)
Emits a Mark event with the specified text.
public void Mark(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The text. |
Mark(String, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>, Nullable<ProfilingCustomValue>)
Emits a Mark profiling event with the specified text.
public void Mark(string text, ProfilingCustomValue? value0, ProfilingCustomValue? value1 = null, ProfilingCustomValue? value2 = null, ProfilingCustomValue? value3 = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The event text. |
System.Nullable<ProfilingCustomValue> | value0 | First value (can be int, float, long or double). |
System.Nullable<ProfilingCustomValue> | value1 | Second value (can be int, float, long or double). |
System.Nullable<ProfilingCustomValue> | value2 | Third value (can be int, float, long or double). |
System.Nullable<ProfilingCustomValue> | value3 | Fourth value (can be int, float, long or double). |
Mark(String, Object[])
Emits a Mark event with the specified formatted text.
public void Mark(string textFormat, params object[] textFormatArguments)
Parameters
Type | Name | Description |
---|---|---|
System.String | textFormat | The text format. |
System.Object[] | textFormatArguments | The text format arguments. |
SetAttribute(String, Object)
Sets the attribute value for a specified key. See remarks.
public void SetAttribute(string key, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Object | value | The value. |
Remarks
If profiling was not enabled for this profile key, the attribute is not stored