如何接近“最终客户"?单页(Web)应用程序上的性能测试? [英] How to approach "end-client" performance testing on single-page (web) applications?

查看:101
本文介绍了如何接近“最终客户"?单页(Web)应用程序上的性能测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在评估如何在单页应用程序( SPA )上测试性能高度依赖JavaScript和动态内容(通过Ajax更新).

We are evaluating how to test performance on a single-page application (SPA) which relies heavily on JavaScript and dynamic content (updated via Ajax).

流行的负载测试工具,例如 Apache JMeter 加特林能够通过发送HTTP请求以很少的硬件生成巨大的负载.但是他们不处理任何Javascript代码.

Popular load-testing tools like Apache JMeter or Gatling are able to generate huge loads with little hardware by sending HTTP requests. But they do not process any Javascript code.

我们要衡量客户端所感知的性能,即坐在浏览器前的最终用户所感知的性能(包括所有渲染和JavaScript开销).

We would like to measure performance as perceived by the client, that is, as perceived by end-user sitting in front of a browser (with all the rendering and JavaScript overhead included).

我们有以下几种选择:

  1. 使用Selenium Grid在多台计算机上同时运行测试脚本.每个实例将在运行时收集的延迟数据提交到中央存储库.

  1. Use Selenium Grid to run a test script concurrently on several machines. Each instance submits latency data collected at runtime to a central repository.

与上述类似,不同之处在于仅启动了一个Selenium脚本实例.然后,我们将使用JMeter/Gatling在后台生成繁重的负载.

Similar to above, except that only one Selenium script instance is started. We would then JMeter/Gatling to generate the heavy load in the background.

完全不使用Selenium.使用JMeter/Gatling运行负载测试时,请使用Firebug,YSlow等工具手动检查页面的行为.

Do not use Selenium at all. While running a load test using JMeter/Gatling, manually inspect the behaviour of the page by using tools like Firebug, YSlow, etc.

每种方法都有其优点和缺点.在(1)上,我能够创建最切合实际"的负载,但它无法缩放,(2)可通过JMeter/Gatling缩放,但我必须确保他们创建的负载与实际应用程序的偏差不会太大,并且(3)是最容易设置的,但是由于它不是自动化的,因此显然很费时间.

Each approach has its strengths and drawbacks. On (1) I'm able to create the most "realistic" load, but it does not scale, (2) scales through JMeter/Gatling, but I have to make sure the load they create do not deviate too much from the actual application and (3) is the easiest to setup, but it's obviously time consuming since it's not automated.

到目前为止,我找不到关于此主题的任何工具,框架,甚至一套指导,因此我想从SO的专家那里了解:他们对这种类型的测试使用哪种方法?

So far I could not find any tool, framework, or even a set of guidelines on this topic, so I would like to know from experts here at SO: what kind of approach you they use for this type of test?

后端性能/负载测试".否则,如果我对最终用户的性能感兴趣,那有什么选择呢?

This entry on the Selenium Grid FAQ states that *"conducting performance/load testing with real browser is a pretty bad idea as it is hard/expensive to scale the load and the actual load is very inconsistent...". I can only think that they refer to "backend performance/load testing". Otherwise, if I'm interested in end-user performance, what's the alternative?

推荐答案

查看JMeter WebDriver http://jmeter-plugins.org/wiki/WebDriverTutorial/.您可以在负载测试中定义一个并行测试,以评估服务器负载时客户端感知的性能.

Check out JMeter WebDriver http://jmeter-plugins.org/wiki/WebDriverTutorial/ . You can define one parallel to your load test in order to gauge performance perceived by the client while the server is under load.

在他们的网站上:

Web驱动程序采样器可自动执行和收集浏览器(客户端)上的性能指标.很大一部分 到目前为止,性能测试一直在服务器端 事物.但是,随着技术的进步,HTML5,JS和CSS 改进,越来越多的逻辑和行为被压低 给客户.这增加了整体的感知性能 网站/webapp,但JMeter中不提供此指标.事物 可能会增加浏览器整体执行时间的

Web Driver Sampler automates the execution and collection of Performance metrics on the Browser (client-side). A large part of performance testing, up to this point, has been on the server side of things. However, with the advancement of technology, HTML5, JS and CSS improvements, more and more logic and behaviour have been pushed down to the client. This adds to the overall perceived performance of website/webapp, but this metric is not available in JMeter. Things that add to the overall browser execution time may include:

客户端Javascript执行-例如AJAX,JS模板CSS 转换-例如3D矩阵变换,动画第三方插件- 例如.喜欢Facebook,双击广告,网站分析等所有这些 事情增加了浏览器的整体执行时间,而这个项目 目的是衡量完成所有渲染所需的时间 内容.

Client-side Javascript execution - eg. AJAX, JS templates CSS transforms - eg. 3D matrix transforms, animations 3rd party plugins - eg. Facebook like, Double click ads, site analytics, etc All these things add to the overall browser execution time, and this project aims to measure the time it takes to complete rendering all this content.

这篇关于如何接近“最终客户"?单页(Web)应用程序上的性能测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆