MiniProfilerExtensions
Contains helper methods that ease working with null ServiceStack.MiniProfiler.MiniProfilers.
Assembly: ServiceStack.NetFramework.dll
View Source
public static class MiniProfilerExtensions
Properties
CustomStepFn
View Source
public static Func<MiniProfiler, string, IDisposable> CustomStepFn { get; set; }
Methods
Inline<T>(MiniProfiler, Func<T>, String)
Wraps <code data-dev-comment-type="paramref" class="paramref">selector</code> in a ServiceStack.MiniProfiler.MiniProfilerExtensions.Step(ServiceStack.MiniProfiler.IProfiler%2cSystem.String%2cServiceStack.MiniProfiler.ProfileLevel)
call and executes it, returning its result.
View Source
public static T Inline<T>(this MiniProfiler profiler, Func<T> selector, string name)
Returns
<T>
Parameters
Type | Name | Description |
---|---|---|
ServiceStack.MiniProfiler.MiniProfiler | profiler | The current profiling session or null. |
|
| System.Func<<T>>
| selector | Method to execute and profile.
|
| System.String
| name | The ServiceStack.MiniProfiler.Timing step name used to label the profiler results.
|
Type Parameters
T
Step(IProfiler, String, ProfileLevel)
Returns an System.IDisposable
that will time the code between its creation and disposal.
View Source
public static IDisposable Step(this IProfiler profiler, string name, ProfileLevel level)
Returns
System.IDisposable
Parameters
Type | Name | Description |
---|---|---|
ServiceStack.MiniProfiler.IProfiler | profiler | The current profiling session or null. |
|
| System.String
| name | A descriptive name for the code that is encapsulated by the resulting IDisposable's lifetime.
| | ServiceStack.MiniProfiler.ProfileLevel | level | This step's visibility level; allows filtering when MiniProfiler.Start is called.
|
AddProfilerResults(MiniProfiler, MiniProfiler)
Adds <code data-dev-comment-type="paramref" class="paramref">externalProfiler</code>'s ServiceStack.MiniProfiler.Timing hierarchy to this profiler's current Timing step, allowing other threads, remote calls, etc. to be profiled and joined into this profiling session.
View Source
public static void AddProfilerResults(this MiniProfiler profiler, MiniProfiler externalProfiler)
Parameters
Type | Name |
---|---|
ServiceStack.MiniProfiler.MiniProfiler | profiler |
ServiceStack.MiniProfiler.MiniProfiler | externalProfiler |
Render(MiniProfiler)
Returns an html-encoded string with a text-representation of <code data-dev-comment-type="paramref" class="paramref">profiler</code>; returns "" when profiler is null.
View Source
public static IHtmlString Render(this MiniProfiler profiler)
Returns
Parameters
Type | Name | Description |
---|---|---|
ServiceStack.MiniProfiler.MiniProfiler | profiler | The current profiling session or null. |
|
GetMiniProfiler(IProfiler)
View Source
public static MiniProfiler GetMiniProfiler(this IProfiler profiler)
Returns
ServiceStack.MiniProfiler.MiniProfiler
Parameters
Type | Name |
---|---|
ServiceStack.MiniProfiler.IProfiler | profiler |