WebRequestProfilerProvider
HttpContext based profiler provider. This is the default provider to use in a web context. The current profiler is associated with a HttpContext.Current ensuring that profilers are specific to a individual HttpRequest.
Assembly: ServiceStack.NetFramework.dll
View Source
public class WebRequestProfilerProvider : BaseProfilerProvider, IProfilerProvider
Methods
Start(ProfileLevel)
Starts a new MiniProfiler and associates it with the current System.Web.HttpContext.Current
.
View Source
public override MiniProfiler Start(ProfileLevel level)
Returns
ServiceStack.MiniProfiler.MiniProfiler
Parameters
Type | Name |
---|---|
ServiceStack.MiniProfiler.ProfileLevel | level |
Stop(Boolean)
Ends the current profiling session, if one exists.
View Source
public override void Stop(bool discardResults)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | discardResults |
When true, clears the ServiceStack.MiniProfiler.MiniProfiler.Current for this HttpContext, allowing profiling to be prematurely stopped and discarded. Useful for when a specific route does not need to be profiled.
|
GetCurrentProfiler()
Returns the current profiler
View Source
public override MiniProfiler GetCurrentProfiler()
Returns
ServiceStack.MiniProfiler.MiniProfiler
Inherited Methods
GetCurrentProfiler()
Returns the current MiniProfiler. This is used by ServiceStack.MiniProfiler.MiniProfiler.Current.
View Source
public abstract MiniProfiler GetCurrentProfiler()
Returns
ServiceStack.MiniProfiler.MiniProfiler
SaveProfiler(MiniProfiler)
Calls ServiceStack.MiniProfiler.MiniProfiler.Settings.EnsureStorageStrategy
to save the current
profiler using the current storage settings
View Source
protected static void SaveProfiler(MiniProfiler current)
Parameters
Type | Name |
---|---|
ServiceStack.MiniProfiler.MiniProfiler | current |
SetProfilerActive(MiniProfiler)
Sets <code data-dev-comment-type="paramref" class="paramref">profiler</code> to be active (read to start profiling) This should be called once a new MiniProfiler has been created.
View Source
protected static void SetProfilerActive(MiniProfiler profiler)
Parameters
Type | Name | Description |
---|---|---|
ServiceStack.MiniProfiler.MiniProfiler | profiler | The profiler to set to active |
|
Start(ProfileLevel)
Starts a new MiniProfiler and sets it to be current. By the end of this method ServiceStack.MiniProfiler.BaseProfilerProvider.GetCurrentProfiler() should return the new MiniProfiler.
View Source
public abstract MiniProfiler Start(ProfileLevel level)
Returns
ServiceStack.MiniProfiler.MiniProfiler
Parameters
Type | Name |
---|---|
ServiceStack.MiniProfiler.ProfileLevel | level |
Stop(Boolean)
Stops the current MiniProfiler (if any is currently running). ServiceStack.MiniProfiler.BaseProfilerProvider.SaveProfiler(ServiceStack.MiniProfiler.MiniProfiler) should be called if <code data-dev-comment-type="paramref" class="paramref">discardResults</code> is false
View Source
public abstract void Stop(bool discardResults)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | discardResults | If true, any current results will be thrown away and nothing saved |
|
StopProfiler(MiniProfiler)
Stops the profiler and marks it as inactive.
View Source
protected static bool StopProfiler(MiniProfiler profiler)
Returns
System.Boolean
: True if successful, false if Stop had previously been called on this profiler
Parameters
Type | Name | Description |
---|---|---|
ServiceStack.MiniProfiler.MiniProfiler | profiler | The profiler to stop |
|