Interface IProfiler
Defines the profiling service.
Namespace: Umbraco.Cms.Core.Logging
Assembly: Umbraco.Core.dll
Syntax
public interface IProfiler
Properties
View SourceIsEnabled
Whether the profiler is enabled.
Declaration
bool IsEnabled { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
View SourceStart()
Starts the profiler.
Declaration
void Start()
Step(string)
Gets an System.IDisposable that will time the code between its creation and disposal.
Declaration
IDisposable? Step(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the step. |
Returns
| Type | Description |
|---|---|
| IDisposable | A step. |
Remarks
The returned System.IDisposable is meant to be used within a using (...) {{ ... }} block.
Stop(bool)
Stops the profiler.
Declaration
void Stop(bool discardResults = false)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | discardResults | A value indicating whether to discard results. |
Remarks
Set discardResult to true to abandon all profiling - useful when eg someone is not authenticated or you want to clear the results, based upon some other mechanism.