John
John

Reputation: 439

ServiceStack Profile Steps not rendering

I have a ServiceStack Service with a service call like so:

    public class MyService : Service
    {
        public object Get(MyServiceRequest request)
        {
            using (Profiler.Current.Step("Getting Data"))
            {
                // code that gets data

                using (Profiler.Current.Step("Doing work with data"))
                {
                    // code that does work
                }
            }
            return response;
        }           
    }

and a global.asax.cs like so:

public class Global : System.Web.HttpApplication
{

    protected void Application_Start(object sender, EventArgs e)
    {
        new AppHost().Init();
    }

    protected void Application_BeginRequest(object sender, EventArgs e)
    {
        if (Request.IsLocal)
            Profiler.Start();
    }

    protected void Application_EndRequest(object sender, EventArgs e)
    {
        Profiler.Stop();
    }       
}

My problem is that when I test the service call through the browser I only see profile information for the overall request. "show time with children" and "show trivial" don't provider any more granular information. I've also placed breakpoints within each using statement to get a look at Profiler.Current and noticed in each case its Children property is null. Am I doing it wrong? Are they any other things I can do to troubleshoot this?

Upvotes: 1

Views: 158

Answers (1)

John
John

Reputation: 439

For some reason setting the level argument to Profile.Info in the Step method resolves my issue. That's weird because Profile.Info is the default if no argument is provided. Oh well. Moving on.

Upvotes: 1

Related Questions