Capture and Profile Every Entity Framework Operation In Production
Just Register the Loupe Agent
The Loupe Agent for Entity Framework is available from NuGet (the preferred source) for .NET Core and .NET 5.
Once you’ve added the Agent all you need to do is register it with Entity Framework so it will start listening to requests. This is just a one line command which can be done any time in your application (and if called multiple times is safe).
//Register the Interceptor
After this call is made any Entity Framework operation in your application domain will be recorded.
See Every Query Your Application Runs
The exact SQL generated by Entity Framework is captured including:
- Full SQL Query Executed: The exact query generated by your provider for your database.
- Parameters and Values: So you know exactly how to replicate the performance.
- Server Connection Information: For applications that are accessing multiple databases or different types of databases.
- Stack Trace: Know exactly what code path caused the database operation.
- Transaction and Isolation: See which operations are part of a common transaction and what isolation level they’re using.
Know What Operations are Driving Your Performance
- Top Queries by Total Time: The database operations your app is spending the most time with.
- Slowest Queries: The operations taking the most time per call, on average or 90th percentile.
- Most Common Queries: The operations most frequently executed in your application
You can also get a complete list of every database operation and its parameters to identify operations that are only occasionally slow.
Relate It All To Your Code
Database operations are recorded in the log stream with everything else going on with your application. By seeing each operation in context you can identify problems like:
- Excessive queries being performed within a single application unit of work.
- Lazy loading performance problems.
- Events leading up to failed database operations.
- Multithreaded concurrency issues when operations execute in parallel.
Even in Production
Unlike other tools, Loupe is designed for continuous use in production so you can get critical diagnostic and performance information where you need it most - in the real world where your application has to deliver!
The best way to understand how Loupe can help you support Entity Framework is to Download Loupe Desktop, integrate it, and use it free forever.
For more details about using Loupe with Entity Framework, check out these pages in our product documentation: