O'Reilly logo

Mastering ServiceStack by Andreas Niedermair

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Profiling requests

The next step is to dig deeper into the timings of your service to examine the concrete request and its execution chain. ServiceStack comes with an adapted implementation of MiniProfiler (original implementation available at http://miniprofiler.com/), a simple but effective mini-profiler.

Its main goal is to bring profiling to hosted services, but we will implement a solution that works for self-hosted services as well.

To start profiling, we need to adapt the Application_BeginRequest method in Global.asax file, as shown:

using System; using System.Web; using ServiceStack; using ServiceStack.MiniProfiler; public partial class Global : HttpApplication { protected void Application_BeginRequest(object sender, EventArgs e) { Profiler.Start(); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required