Skip to main content

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
Declaration
public class WebRequestProfilerProvider : BaseProfilerProvider, IProfilerProvider

Methods

Start(ProfileLevel)

Starts a new MiniProfiler and associates it with the current System.Web.HttpContext.Current.

View Source
Declaration
public override MiniProfiler Start(ProfileLevel level)
Returns

ServiceStack.MiniProfiler.MiniProfiler

Parameters
TypeName
ServiceStack.MiniProfiler.ProfileLevellevel

Stop(Boolean)

Ends the current profiling session, if one exists.

View Source
Declaration
public override void Stop(bool discardResults)
Parameters
TypeNameDescription
System.BooleandiscardResults

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
Declaration
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
Declaration
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
Declaration
protected static void SaveProfiler(MiniProfiler current)
Parameters
TypeName
ServiceStack.MiniProfiler.MiniProfilercurrent

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
Declaration
protected static void SetProfilerActive(MiniProfiler profiler)
Parameters
TypeNameDescription
ServiceStack.MiniProfiler.MiniProfilerprofilerThe 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
Declaration
public abstract MiniProfiler Start(ProfileLevel level)
Returns

ServiceStack.MiniProfiler.MiniProfiler

Parameters
TypeName
ServiceStack.MiniProfiler.ProfileLevellevel

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
Declaration
public abstract void Stop(bool discardResults)
Parameters
TypeNameDescription
System.BooleandiscardResultsIf true, any current results will be thrown away and nothing saved

|

StopProfiler(MiniProfiler)

Stops the profiler and marks it as inactive.

View Source
Declaration
protected static bool StopProfiler(MiniProfiler profiler)
Returns

System.Boolean: True if successful, false if Stop had previously been called on this profiler

Parameters
TypeNameDescription
ServiceStack.MiniProfiler.MiniProfilerprofilerThe profiler to stop

|

Implements