Glimpse is a popular diagnostics and profiling framework, built especially for .NET web applications. In this recipe, we will show you how to use Glimpse and the Glimpse.NHibernate add-on, in order to profile NHibernate requests.
Open an existing ASP.NET web application project that uses NHibernate or complete the Setting up session-per-web request recipe from Chapter 3, Sessions and Transactions.
Install-Package Glimpse.MVC5
NHibernate.Glimpse
package using the NuGet Package Manager Console by executing the following command:Install-Package NHibernate.Glimpse
/glimpse.axd
./books
page in the example application.Once enabled, Glimpse uses an ASP.NET HttpModule
, which injects markup and script into your page, in order to display its user interface. Normally, this is activated only when the application is running locally.
Additionally, the NHibernate add-on configures a custom logger, which intercepts NHibernate's log messages and parses them into data points for Glimpse.
All necessary configurations will be added by the NuGet package installer, but if you want to see detailed data about the executed commands, you can edit an appSetting
in web.config
.
<add key="NHibernate.Glimpse.Loggers" value="command,connection,flush,load,transaction"/>
More information about Glimpse can be found at http://getglimpse.com.
18.226.164.75