问题描述
基本上,我有一个使用asp.net的MVC框架4的Web应用程序。我使用C#作为我的后端。在天不同时间,我注意到,Web应用程序或滞后是缓慢的,但我想弄清楚一天,这将是搞清楚如何优化应用程序有用的一些其它信息的哪个时间。我希望能够写一个自动化脚本,测试在一天的不同时间的Web应用程序,将其与应用程序的缓慢。
Basically, I have a web application that uses asp.net mvc 4 framework. I use C# as my backend. At different times of the days, I noticed that the web application lags or is slow but I would like to figure out which times of day and some other information that would be useful in figuring out how to optimize the app. I want to be able to write an automated script that tests the web application at different times of the day and correlate it to the slowness of the application.
我是pretty新的测试自动化,所以我想知道我在哪里可以开始用脚本这样的事情。尤其对于asp.net web应用程序?
I'm pretty new to test automation, so I was wondering where could I start with scripting such things. In particular for asp.net web apps?
推荐答案
您可以从几个角度接近这一点:
You can approach this from a few angles:
日志东西
登录页面的渲染时间,数据库访问时间,以及其他任何可能导致缓慢倍。使用日志框架,如,使您可以拨打向上和向下细节的数量在日志中需要
Log page rendering times, database access times, and times of anything else that might cause slowness. Use a logging framework such as NLog that allows you to dial up and down the amount of detail you need in the log.
获取更多细节,而手动浏览
MiniProfiler 在你的网站,并把它转化,当你登录的。
Integrate MiniProfiler in your website, and have it turn on when you log in.
测量选定的页面的现场表演
的快速启动的解决方案是使用许多外部测试解决方案之一在那里。谷歌的衡量网站性能免费的一个广阔的选择。
The fast-start solution is to use one of the many external testing solutions out there. Google measure website performance free for a broad selection.
如果你想这个自己构建,特别是如果你想测试复杂的工作流程,我已经取得了巨大成功与。 JMeter的设计压力为目标测试基准,不住,环境。不过,你可以用它来对周期性生产系统运行测试,只要测试没把那么多讲究系统上,以便该问题的原因。
If you want to build this yourself, and especially if you want to test complex workflows, I have had great success with JMeter. JMeter is designed with the goal of stress testing a benchmarking, not live, environment. However, you could use it to periodically run tests against your production system as long as the tests do not place so much stress on the system so as to be the cause of the problem.
使用托管溶液来测量页面性能的一个优点是,它们可以从世界不同地方进行测量。在一些情况下,网络延迟可以是整体页面性能的一个重要组成部分。
One advantage of using a hosted solution to measure page performance is that they can measure it from different parts of the world. In some cases, the network latency can be an important component of overall page performance.
这篇关于我如何使用自动脚本测试在一天中的不同时间我的web应用程序的表现呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!