问题
I'm a junior developer and I was assigned to find out why web applications slow current request takes about eight seconds, but I do not know how to begin to profile how to find out what's going on SQL server, which functions takes a lot of time. The application is written in ASP.NET MVC 5 and uses Entity Framework 6. Where should I start?
回答1:
If you're not a database boy like me, you'll love using Glimpse.
Glimpse is the diagnostics platform of the web.
Providing real time diagnostics & insights to the fingertips of hundreds of thousands of developers daily.
So you can start by grabbing Glimpse from NuGet.
PM> Install-Package Glimpse.MVC5
PM> Install-Package Glimpse.EF6
Initial configuration is the following:
- In the configSections:
- And after that:
Sorry for that but i waste 10 minutes trying to add xml code/quote/everything. For further configuration and others, here: http://getglimpse.com/Docs/Configuration
After that you must navigate to /glimpse.axd or what path did you specified there and enable (it's a cookie).
Here is a site that is using Glimpse so you can see what's giving to you. Render view time/wire time/sql time/ajax profiling & so on.. http://play.getglimpse.com/
It is very extensible having plugins and so on. You can search.
And here is a talk that you can watch for reviewing some features and to convince you to use glimpse: https://www.youtube.com/watch?v=IGMYogdKYyw
And if you need to see ONLY the sql queries not the whole (rendering process etc.) you can press the glimpse circle and go to the sql tab. You'll have a view like the following:
来源:https://stackoverflow.com/questions/30828518/asp-net-mvc-application-profiling