2011-11-05 2 views

Répondre

12

Il existe plusieurs façons d'intégrer le profileur nhibernate dans votre application. Une façon consiste à utiliser l'appender log4net profileur nhibernate personnalisé. Vous pouvez savoir comment utiliser cette façon ici:

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

Une autre façon de le faire est d'inclure HibernatingRhinos.Profiler.Appender.v4.0.dll dans votre projet et inclure quelque part le code suivant au démarrage (j'inclus habituellement dans ma classe d'aide SessionFactory initialisant mon SessionFactory et mains 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(); 

aussi, si vous voulez voir les statistiques NHibernate à l'intérieur profileur NHibernate vous devez inclure les éléments suivants dans votre NHibernate section de configuration:

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

Toutes ces informations peuvent être trouvées ici: http://nhprof.com/