基于react js的站点性能测试应该采用什么方法-Jmeter

What should be the approach for react js based site's performance testing-Jmeter

我有一个在 React js 中的应用程序。这里我给演示站点 https://webix.com/demos/bank-app/#!/top/customers?user=1/information 。假设我必须对统计页面选项卡进行性能测试,我该怎么做。由于所有资源都是从我点击 ttps://webix.com/demos/bank-app/ 页面时开始下载的。现在,当我转到 chrome 开发人员工具并单击客户->统计时,它只显示静态 file.my 客户希望我检查这些图表加载时间的性能。

谁能帮忙。

我还必须为页面上加载的图表加载测试 google API。有很多 SVG 文件和 woff2 文件。我必须对这些东西进行负载测试吗?

谢谢, 比贝克

尝试 Google 灯塔一次。它将简要介绍基本改进。通过这个你可以实现大量的性能改进。那么你可以使用 JMeter。

client wants me to check the performance of those chart load time - 如果你的意思是图表 rendering 时间 - JMeter 不会给你这个,根据 JMeter project main page:

JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).

因此,如果您想将此渲染时间包含在您的报告中,我能想到的唯一选择是 WebDriver Sampler which provides JMeter integration with Selenium 浏览器自动化框架

There is so many SVG files and woff2 file. do I have to load test these things. - 是的,但明智的是,在 HTTP Request 采样器的“高级”选项卡中有一个特殊设置,负责检索这些图像、脚本、样式、字体等

想法是为您正在测试的域启用下载(并排除外部资产,如果有的话)。也不要忘记添加 HTTP Cache Manager to your test plan because real browsers do download these "embedded resources" but they do it only once. See Web Testing with JMeter: How To Properly Handle Embedded Resources in HTML Responses 文章以获取更多详细信息。