Production profiling

ORM Profiler supports production profiling in the following way: after the InterceptorCore.Initialize method has been called, DbProviderFactory types are wrapped for the application. By default every ADO.NET activity is intercepted and sent via messages to the client.

Even when no client is listening (and no messages are sent) it can still hurt performance a bit when the interceptor collects profiling information into messages in the profiled application.

Production profiling is to switch off message creation entirely. This only creates a tiny overhead inside the wrapper ADO.NET objects. To disable profiling entirely, do the following:

InterceptorCore.DisableMessageSending();

After this call, no message is sent from the profiled application. To enable profiling again, do:

InterceptorCore.EnableMessageSending();

This way you can enable collecting profiling information at runtime manually. The method is global, for all threads in the current Appdomain. By default, message sending is enabled.