How to get started for NHibernate Profiler

I have a Wpf application using Nhibernate. I want to view the details of a submitted request to the NHibernate Profiler database. What needs to be done for the initial launch?

+7
source share
1 answer

There are several ways to integrate the nhibernate profiler into your application. One way is to use the custom norkernate profiler log4net appender. You can learn how to use this method here:

http://nhprof.com/Learn/Usage/ProfileAppWithConfiguration

Another way to do this is to include HibernatingRhinos.Profiler.Appender.v4.0.dll in your project and include the code at startup (usually I include this in my helper class SessionFactory which initializes my SessionFactory and distributes ISessions):

//Using statement needed for the statement below using HibernatingRhinos.Profiler.Appender.NHibernate; //Initialize so that we can use NHibernate Profiler (http://nhprof.com/) NHibernateProfiler.Initialize(); 

Also, if you want to view nhibernate statistics from the nhibernate profiler, you need to include the following in the nhibernate configuration section:

 <property name="generate_statistics">true</property> 

All of this can be found here: http://nhprof.com/

+12
source

All Articles