ASP.NET MVC应用程序分析

问题描述:

我是一个初级开发人员,我被分配了解为什么Web应用程序缓慢的请求大约需要八秒钟,但是我不知道如何开始配置如何找出SQL Server上发生了什么,哪些功能需要很多时间。应用程序是用ASP.NET MVC 5编写的,并使用实体框架6.我应该从哪里开始?

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?

不是像我这样的数据库男孩,你会喜欢使用Glimpse。

If you're not a database boy like me, you'll love using Glimpse.

Glimpse是网络的诊断平台。

Glimpse is the diagnostics platform of the web.

提供实时诊断和每天都有成千上万的开发人员的指尖。

Providing real time diagnostics & insights to the fingertips of hundreds of thousands of developers daily.

所以你可以从NuGet手中抓住Glimpse。

So you can start by grabbing Glimpse from NuGet.

PM> Install-Package Glimpse.MVC5

PM> Install-Package Glimpse.EF6

初始配置如下:


  • 在configSections中:


  • 之后:

对不起为此,我浪费10分钟尝试添加xml代码/报价/一切。
有关进一步的配置和其他配置,请执行以下操作: http://getglimpse.com/Docs/Configuration

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

之后,您必须导航到/glimpse.axd或您在那里指定的路径并启用(它是一个cookie)。

After that you must navigate to /glimpse.axd or what path did you specified there and enable (it's a cookie).

这是一个使用Glimpse的网站,所以你可以看到给你的是什么。渲染视图时间/线时间/ sql时间/ ajax分析&所以..
http://play.getglimpse.com/

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.

这里是一个演讲,您可以观看一些功能,并说服您使用一瞥: https://www.youtube.com/watch?v=IGMYogdKYyw

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

如果你只需要看到sql查询不是整个(渲染过程等),你可以按一下瞥见圈子并转到sql选项卡。您将看到如下所示的视图:

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: