MiniProfiler ships with a large amount of possible configuration options, they all live in the file MiniProfiler.Settings.cs, in general we try to ship with sane defaults, sometimes you may wish to change these defaults:

ExcludeAssembly(assemblyName) – Can be used to exclude an assembly from the Stack Trace – Defaults to: “StackExchange.Profiling, Emitted Assemblies, System.Core, System.Data, System.Data.Linq, System.Web, System.Web.MVC.

ExcludeType(typeName) – Defaults to SqlMapper, you can add additional types you wish to suppress.

ExcludeMethod(methodName) – Defaults to lambda_method, .ctor, you can add additional methods you wish to suppress.

MaxUnviewedProfiles – Default(20): The maximum number of unviewed profiler sessions (set this low cause we don’t want to blow up headers)

StackMaxLength – The max length of the stack string to report back; defaults to 120 chars.

TrivialDurationThresholdMilliseconds – Any Timing step with a duration less than or equal to this will be hidden by default in the UI; defaults to 2.0 ms.

PopupShowTimeWithChildren – Dictates if the “time with children” column is displayed by default, defaults to false. For a per-page override you can use .RenderIncludes(showTimeWithChildren: true/false)

PopupShowTrivial – Dictates if trivial timings are displayed by default, defaults to false. For a per-page override you can use .RenderIncludes(showTrivial: true/false)

PopupMaxTracesToShow – Determines how many traces to show before removing the oldest; defaults to 15. For a per-page override you can use .RenderIncludes(maxTracesToShow: 10)

PopupRenderPosition – Dictates on which side of the page the profiler popup button is displayed; defaults to left. For a per-page override you can use .RenderIncludes(position: RenderPosition.Left/Right)

ShowControls – Determines if we are to show controls that allow you to minimize hide and clear profiling ui; defaults to false. For a per-page override you can use .RenderIncludes(showControls: true/false)

UseExistingjQuery – Defaults to false; MiniProfiler ships with a standalone copy of jQuery, if you wish to use an already loaded version of jQuery instead set to true.

ExcludeStackTraceSnippetFromSqlTimings – By default, SqlTimings will grab a stack trace to help locate where queries are being executed. When this setting is true, no stack trace will be collected, improving profiler performance.

IgnoredPaths – When MiniProfiler.Start is called, if the current request url contains any items in this property, no profiler will be instantiated and no results will be displayed. Default value is { “/content/”, “/scripts/”, “/favicon.ico” }.

RouteBasePath – The path under which ALL routes are registered in, defaults to the application root. For example, “~/myDirectory/” would yield “/myDirectory/includes.js” rather than just “/mini-profiler-resources/includes.js” Any setting here should be in APP RELATIVE FORM, e.g. “~/myDirectory/”

MaxJsonResponseSize – Maximum payload size for json responses in bytes defaults to 2097152 characters, which is equivalent to 4 MB of Unicode string data.

Storage – Defines the storage engine used to persist MiniProfiler engines, by default data is stored in the Http Runtime this storage is not shared between IIS instances, we also ship with a Sql Server based storage engine that can be easily shared.

SqlFormatter – The formatter used for SQL statements being rendered. Takes care of formatting parameter names and values. By default we use the InlineFormatter you could also use the OracleFormatter or SqlServerFormatter.

ProfilerProvider – The provider used to generate MiniProfiler objects, by default we use a WebRequestProfilerProvider that is designed for web requests. By implementing this provider you can add support for WPF, Console or other types of profiling.

Results_Authorize – A function that determines who can access the MiniProfiler results url and list url. It should return true when the request client has access to results, false for a 401 to be returned. HttpRequest parameter is the current request and the HttpRequest parameter that will be passed into this function should never be null. By default everyone is allowed to see results.

ResultsListAuthorize – Experimental, defaults to null. When set users who pass this function have access to a listing of recent profiling sessions/

Additionally there is a “web specific” setting in WebRequestProfilerProvider:

UserProvider: A provider that returns user identification for the current request.

Return to Knowledge Base