The StackExchange Mini Profiler is a nice tool to help you see where your pages and queries are spending most of their time. 

It gives you a little jewel in your page that you can click on to see info like:



While setup is easy, I was going to build a way for it to be enabled/disabled on a per-session basis so that developers could tur n it off and on as needed.  So I decided to make it into a nuget package.

The nuget package is here:

and the source is hosted here:

Adding a reference to this from your web project will cause the StackExchange MiniProfiler to profile for all requests (by default), but only show them to you if you choose to enable it for your session.  To enable display of the values, you simply browse to ~/MiniProfiler/true (or false to turn it back off).

Because the MiniProfiler will cache up to 15 request profiling sessions, this means a developer can notice a page took a long time to load, and after it completes, browse to ~/MiniProfiler/true to see the profile session that contains the info for what caused the slow page processing on the earlier request.

If you don’t want the profiler to always be monitoring, you can disable it with

MiniProfilerHttpModule.AlwaysProfile = false;

in your application startup code.

By default, the application will also always profile local requests.  This can be disabled with:

MiniProfilerHttpModule.AlwaysProfileLocalRequests= false;