Page 1 of 1

Using Glimpse for debugging and nhibernate profiling

Posted: Mon Oct 26, 2015 2:02 am
by mazhar
Glimpse is an open source Diagnostics platform which is gaining popularity. It provides very useful insight into web codes with convenience. If you people have used FireBug then Glimpse will look very familiar due to its UI similarities, but much more powerful since it runs on Server and not just your browser. There are lots of plugins built around glimpse to provide easy diagnostics for different solutions including ASP.NET MVC and ASP WebForms. A more interesting plugin that made me look into Glimpse is Nhibernate.Glimpse which helps you profile SQL generate by Nhibernate right into your browser! You can read more about Glimpse here

I spent some time to see if I can make glimpse and nhibernate.glimpse work within ablecommerce and it turned out to be successful. Both Glimpse and Nhibernate.Glimpse are available as nuget packages but I choose to manually install them. The resulting patch is very small which includes four DLLs and few updates in web.config. By default Glimpse works on localhost but security policy can be adjusted to make it work on remote/live website.

Attached is patch containing modified web.config and required dlls for GoldR11.

NOTE: Glimpse doesn't work in Medium Trust so make sure you are running under full trust. In order to check your trust level simply login to AbleCommerce Admin and Go Dashboard -> Help. Make sure in there you see ASP.NET TRUST: Unrestricted

How to use?
1- Install the patch in same directory structure
2- After completing the install browse following URL

Code: Select all

3- Click Turn On button which will set Cookie flagging Glimpse is enabled
4- Now Ctrl+F5 (hard refresh) store home.
5- At page bottom you would see Glimpse Icon and tool bar. If you click Glimpse icon it will open FireBug like tabs providing different useful information.
6- Open Nhibernate tab to see queries ran again current request.
7- For remote website you will have to uncomment following configuration in web.config

Code: Select all

  <glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
            <add type="Glimpse.Core.Policy.ControlCookiePolicy, Glimpse.Core"/>