I need to do some performance testing for an ASP.NET MVC application and specifically want to measure how many databsae queries each HTTP request results in. The data access layer is using LINQ-to-SQL.
I'd like to be able to automate the tests so am looking for a good way to be able to do a before and after count of the number of SQL queries. The possibilites I can think of are:
- A performance monitor counter for the ASP.NET process,
- A system table in the MSSQL database that can be queried before and after each page request,
- A property somewhere in the System.Data.SQLClient namespace that tracks the number of queries executed by the process.
Has anyone done this before and can perhaps point my down the right path?