分析 Web 应用程序请求

发布于 2024-09-30 21:46:48 字数 161 浏览 5 评论 0原文

我正在构建一个网络应用程序,其中一项任务是提高性能。我想知道有什么工具可以用来计时网页。

例如,我需要能够向经理记录某个特定页面的加载时间为 5 秒,现在只需要 1 秒。

有什么工具可以帮助解决这个问题吗?它不是一个可公开访问的网站,并且是用 ASP.NET MVC 编写的。

I am building a web app and one of the tasks is to improve performance. I want to know of any tool that can be used for timing web pages.

For example I need to be able to document to the managers that a particular page did take 5 seconds to load and now takes 1 second.

Are there any tools that can help with this? It is not a publicly accessible web site and is written in ASP.NET MVC.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

勿忘心安 2024-10-07 21:46:48

我使用 fiddler 来测试我的网页的性能。

尽管默认情况下它会忽略本地主机请求,但您甚至可以使用在线提供的各种提示(如 此处这里

通常对于任何请求,它都会为您提供如下所示的计时信息

ACTUAL PERFORMANCE
--------------
ClientConnected:    11:02:55.765
ClientBeginRequest: 11:02:55.765
ClientDoneRequest:  11:02:55.765
Gateway Determination:  0ms
DNS Lookup:         0ms
TCP/IP Connect:     0ms
ServerConnected:    11:02:55.765
FiddlerBeginRequest:    11:02:55.765
ServerGotRequest:   11:02:55.765
ServerBeginResponse:    11:02:55.890
ServerDoneResponse: 11:02:56.546
ClientBeginResponse:    11:02:56.546
ClientDoneResponse: 11:02:56.546

    Overall Elapsed:    00:00:00.7812500

编辑:您还可以将整个会话保存为会话存档 - 这可以用于记录特定事件序列的结果和所实现的性能。这可以用作“文档”来给您的经理留下深刻印象并跟踪绩效改进。

编辑:您还可以 将 Fiddlers 会话保存为 Visual Studio Web 测试。这有助于创建测试,特别是如果您使用 Visual Studio Web 测试工具
替代文字

I use fiddler to test the performance of my web pages.

Though it ignores localhost requests by default, you can make it work even for those using various tips available online like here or here

Usually for any request, it will give you timing information broken down like below

ACTUAL PERFORMANCE
--------------
ClientConnected:    11:02:55.765
ClientBeginRequest: 11:02:55.765
ClientDoneRequest:  11:02:55.765
Gateway Determination:  0ms
DNS Lookup:         0ms
TCP/IP Connect:     0ms
ServerConnected:    11:02:55.765
FiddlerBeginRequest:    11:02:55.765
ServerGotRequest:   11:02:55.765
ServerBeginResponse:    11:02:55.890
ServerDoneResponse: 11:02:56.546
ClientBeginResponse:    11:02:56.546
ClientDoneResponse: 11:02:56.546

    Overall Elapsed:    00:00:00.7812500

EDIT: You can also save an entire session as an session archive - which can be used to document the results of a particular sequence of events and the achieved performance. This can be used as "documentation" to impress your managers and to keep track of the performance improvements.

EDIT : You can also save Fiddlers session as a Visual Studio web test. This helps in creating the tests especially if you are using Visual Studio Web Testing tools
alt text

泛滥成性 2024-10-07 21:46:48

我通过在访问日志中记录响应时间来处理这个问题。 Apache 支持这一点,因此您可以通过代理服务器进行代理。 IIS 可能支持相同的自定义日志格式。然而,服务器端的日志记录仅涵盖页面传递的速度。

感知响应时间高度依赖于正确的 HTML 和 CSS。提供包含内容的尺寸可以显着加快页面的渲染时间。它可以允许页面的可见部分在页面完成下载之前呈现并稳定。

CSS、脚本库和图像等包含内容的下载时间也会对感知响应产生重大影响。

客户端 Web 测试工具可能会为此类工作提供更好的解决方案。如果做得正确,他们还将证明您没有破坏网站。

I handle this by logging response times in the access log. Apache supports this, so you could proxy through a proxy server. IIS may support the same in a custom log format. However, logging on the server side only covers how fast the page is delivered.

Perceived response time is highly dependent on proper HTML and CSS. Providing sizes for included content can speed rendering time for the page significantly. It can allow the visible portion of a page to render and stabilize before the page had finished downloading.

Download times for included content such as CSS, script libraries, and images can also have a significant impact on perceived response.

Client side web testing tools may provide a better solution for this kind of effort. Done correctly, they will also demonstrate that you haven't broken the web site.

梦言归人 2024-10-07 21:46:48

Chrome 和 Safari 可以使用其开发工具测量页面加载时间。 Fiddler 也可以做到这一点,尽管它不能为您提供很好的聚合图片。我怀疑 Firebug 也可以做到这一点,但我从未使用过它,所以不能保证它。

请注意,这些用于手动测量。如果您想进行自动化的完美测试,可以运行多个场景,聚合数据并将其与基线进行比较,从而获得变化的增量,还有更复杂的工具。如果您生活在 Microsoft 世界,您可以使用 Visual Studio 集成测试工具,或独立的 Web Capacity Analisys 工具。如果您生活在开源世界中,请看看 Apache JMeter。还有许多第三方工具,当您搜索“网页性能测试”时就会显示出来。

Chrome and Safari can measure the page load time with their development tools. Fiddler also can do this, albeit it does not give you as nicely aggregated picture. I suspect Firebug also can do this, but I never used it, so can't vouch for it.

Note that these are for manual measurement. There are more sophisticated tools, if you want to do automated perfect testing that will run multiple scenarios, aggregate the data and compare it to a baseline to give you a delta of the changes. If you live in Microsoft world, you can Use Visual Studio integrated test tools, or the standalone Web Capacity Analisys Tool. If you live in the open source world, take a look at Apache JMeter. There are also number of third-party tools, showing when you search for "web page performance testing".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文