Performance monitoring options in Entity Framework 4.1
-
14-02-2021 - |
Question
I am developing a custom Content Management System in C# (SQL Server 2005) for my organization that operates primarily on Entity Framework 4.1. I would like some insight as to how my application is running, specifically when it comes to my EF queries.
What I'm looking for is a way to monitor the quantity, speed and actual execution (translated SQL) of queries being executed within a given period of time. Essentially I'd like to add DB profiling functionality into my application.
If at all possible I would to do this without implementing custom monitoring code for each one of my repository functions.
My question is this:
What is the simplest way to monitor in/out performance of the Entity Framework queries. I would like the following data:
- A list of queries executed within the profiling time-span
- For each query I would like to see execution time and actual SQL
- If possible, the result size for each query would be helpful too
Solution
You can use an existing tool, such as the Hibernating Rhinos EF Profiler.