2

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:

  1. A list of queries executed within the profiling time-span
  2. For each query I would like to see execution time and actual SQL
  3. If possible, the result size for each query would be helpful too
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Andrew Munro
  • 172
  • 1
  • 1
  • 9

1 Answers1

1

You can use an existing tool, such as the Hibernating Rhinos EF Profiler.

Oded
  • 489,969
  • 99
  • 883
  • 1,009
  • I definitely can use an EF profiler but my preference would be to handle within this code so I can return the results through a web service. – Andrew Munro Oct 26 '11 at 17:10
  • @munroan - You can export profiler results and import into a DB or for use in a web service. – Oded Oct 26 '11 at 17:11