Search code examples
asp.net-mvc-3profilingglimpse

Custom Timeline items in Glimpse


I've only just started looking a profiling for an MVC3 application.

I found MiniProfiler first, and then found recommendations for using Glimpse. Both seem great, and I'd rather use Glimpse, but I'd like to add entries to the timeline for specific actions.

MiniProfiler has a nice feature where you can grab the current MiniProfiler context and add a step with the using() command. Is there a similar thing with Glimpse?

I did find an entry with someone explaining how to do it the long way, but wondered if there might have been a shorter way to do this, since then.


Solution

  • The Google group thread you mentioned is currently the approach that is being developed in version-2 of Glimpse. There you can find the GlimpseTimeline class that does what you want.

    You could take this class and copy it in your own project while waiting for v2 to be released. Just keep in mind that you need to alter it a little bit, as some things like the MessageBroker are to be retrieved from the GlimpseConfiguration.GetConfiguredMessageBroker() etc...

    But it might suit your needs for now...