Using NHibernate Profiler
NHibernate Profiler from Hibernating Rhinos is a powerful tool for analyzing, visualizing what is happening inside your NHibernate application, and for discovering issues you may have. In this recipe, we will show you how to get up and running with NHibernate Profiler.
Getting ready
Download NHibernate Profiler from http://nhprof.com and unzip it. As it is a commercial product, you will also need a license file. You can request a 30-day trial license from the NHProf website.
Using our Eg.Core
model from Chapter 2, Models and Mapping, set up a new NHibernate console application with log4net
, just as we did in Chapter 1, The Configuration and Schema.
How to do it...
Install
NHibernateProfiler.Appender
using the NuGet Package Manager Console by executing the following command:Install-Package NHibernateProfiler.Appender
In the
session-factory
element ofApp.config
, set thegenerate_statistics
property totrue
.Add the following code to your
Main
method:HibernatingRhinos...