BaseProfilerProvider
BaseProfilerProvider. This providers some helper methods which provide access to internals not otherwise available. To use, override the ServiceStack.MiniProfiler.BaseProfilerProvider.Start(ServiceStack.MiniProfiler.ProfileLevel), ServiceStack.MiniProfiler.BaseProfilerProvider.Stop(System.Boolean) and ServiceStack.MiniProfiler.BaseProfilerProvider.GetCurrentProfiler() methods.
Assembly: ServiceStack.NetFramework.dll
View Source
public abstract class BaseProfilerProvider : IProfilerProvider
Methods
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 |
|
GetCurrentProfiler()
Returns the current MiniProfiler. This is used by ServiceStack.MiniProfiler.MiniProfiler.Current.
View Source
public abstract MiniProfiler GetCurrentProfiler()
Returns
ServiceStack.MiniProfiler.MiniProfiler
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 |
|
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 |
|
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 |