Skip to main content

MiniProfilerExtensions

Contains helper methods that ease working with null ServiceStack.MiniProfiler.MiniProfilers.

Assembly: ServiceStack.NetFramework.dll
View Source
Declaration
public static class MiniProfilerExtensions

Properties

CustomStepFn

View Source
Declaration
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
Declaration
public static T Inline<T>(this MiniProfiler profiler, Func<T> selector, string name)
Returns

<T>

Parameters
TypeNameDescription
ServiceStack.MiniProfiler.MiniProfilerprofilerThe 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
Declaration
public static IDisposable Step(this IProfiler profiler, string name, ProfileLevel level)
Returns

System.IDisposable

Parameters
TypeNameDescription
ServiceStack.MiniProfiler.IProfilerprofilerThe 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
Declaration
public static void AddProfilerResults(this MiniProfiler profiler, MiniProfiler externalProfiler)
Parameters
TypeName
ServiceStack.MiniProfiler.MiniProfilerprofiler
ServiceStack.MiniProfiler.MiniProfilerexternalProfiler

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
Declaration
public static IHtmlString Render(this MiniProfiler profiler)
Returns

ServiceStack.IHtmlString

Parameters
TypeNameDescription
ServiceStack.MiniProfiler.MiniProfilerprofilerThe current profiling session or null.

|

GetMiniProfiler(IProfiler)

View Source
Declaration
public static MiniProfiler GetMiniProfiler(this IProfiler profiler)
Returns

ServiceStack.MiniProfiler.MiniProfiler

Parameters
TypeName
ServiceStack.MiniProfiler.IProfilerprofiler