Interface IProfiler
Defines the profiling service.
Namespace: Umbraco.Core.Logging
Assembly: Umbraco.Core.dll
Syntax
public interface IProfiler
Methods
View SourceRender()
Renders the profiling results.
Declaration
string Render()
Returns
Type | Description |
---|---|
System.String | The profiling results. |
Remarks
Generally used for HTML rendering.
Start()
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 |
---|---|---|
System.String | name | The name of the step. |
Returns
Type | Description |
---|---|
System.IDisposable | A step. |
Remarks
The returned System.IDisposable is meant to be used within a using (...) {{ ... }}
block.
Stop(Boolean)
Stops the profiler.
Declaration
void Stop(bool discardResults = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | 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.