Warning: Cannot modify header information - headers already sent by (output started at /www/wwwroot/sbboke.com/wp-content/plugins/wordpress-seo/src/integrations/front-end-integration.php:409) in /www/wwwroot/sbboke.com/wp-content/themes/pacify/content-single.php on line 5

Magento 2性能工具包

上一主题,我们讨论了Magento 2性能优化,在本主题中,让我介绍测试Magento 2存储的Performance工具包。该工具包是Jmeter

性能工具包(Jmeter)

安装计

jMeter:

–转到http://jmeter.apache.org/download_jmeter.cgi并在“二进制”部分下载jMeter(请注意,需要Java 6或更高版本)–解压缩存档

插件(仅当您要使用其他报告(例如图形)时):

–转到http://jmeter-plugins.org/downloads/all/并下载JMeterPlugins-Standard和JMeterPlugins-Extras

–将它们解压缩到jMeter实例的相应ext目录。

–现在可以通过GUI添加其他报告。

jmeter的用法

在首次运行jMeter测试之前,您需要首先使用bin / magento setup:performance:generate-fixtures命令生成测试数据。

通过控制台运行

方案可以接受以下格式描述的参数 :

<host:localhost> URL component 'host' of application being tested (URL or IP). Default is 'localhost'.

<base_path:/> Base path for tested site. Default is '/'.

<report_save_path:./> Path where reports will be saved. Reports will be saved in current working directory by default. Default is './'.

<ramp_period:300> Ramp period (seconds). Period the request will be distributed within. Default is '300'.

<orders:0> Number of orders in the period specified in the current allocation. If <orders> is specified, the <users> parameter will be recalculated. Default is '0'.

<users:100> Number of concurrent users. Recommended  amount is 100. Minimal amount is 10. Default is '100'.

<view_product_add_to_cart_percent:62/> Percentage of users that will only reach the add to cart stage. Default is '62'.

<view_catalog_percent:30/> Percentage of users that will only reach the view catalog stage. Default is '30'.

<guest_checkout_percent:4/> Percentage of users that will reach the guest checkout stage. Default is '4'.

<customer_checkout_percent:4/> Percentage of users that will reach the (logged-in) customer checkout stage. Default is '4'.

<loops:1/> Number of loops to run. Default is '1'.

<admin_path:admin/> Admin backend path. Default is 'admin'.

<admin-user:admin/> Admin backend user. Default is 'admin'.

<admin-password:123123q/> Admin backend password. Default is '123123q'.

<think_time_deviation:1000> Deviation (ms) for "think time" emulation. Default is '1000'.

<think_time_delay_offset:2000> Constant delay offset (ms) for "think time" emulation. Default is '2000'.

必须将必要的参数传递给带有“ J”前缀的命令行:“-J=”

例:

cd / directory_of_jMeter / bin /

jmeter -n -t /path_to_benchmark_file/benchmark.jmx -Jhost = magento2.dev -Jbase_path = / -Jusers = 100 -Jramp_period = 300 -Jreport_save_path =。/

通过GUI运行

–打开jMeter / bin目录并运行jmeter.bat

–单击菜单中的文件->打开(Ctrl + O)并选择文件;或在打开的GUI中拖放Benchmark.jmx文件。

在第一个标签“测试工具包”上,您可以更改“用户定义的变量”,如下所示 , , , , 。

要运行脚本,请单击“开始”(顶部菜单中的绿色箭头)。

运行结果(报告类型)

通过GUI运行后,您可以在左侧面板中查看工作结果。选择相应的报告。

通过控制台运行脚本后,将在以下路径中生成报告: 。

线程数

jMeter脚本包含五个线程。安装程序线程和四个用户线程。

线程之间的百分比比率如下:

浏览,将商品添加到购物车和放弃购物车(报表中的BrowsAddToCart后缀)-62%

仅浏览(报表中的BrowsAddToCart后缀)-30%

浏览,将项目添加到购物车并以访客身份签出(报告中的GuestChkt后缀)-4%

浏览,将商品添加到购物车并以注册客户的身份结帐(报告中的CustomerChkt后缀)-4%

关于报告:

总结报告。报告包含有关线程的汇总信息。

报告文件名为{report_save_path} /summary-report.log

详细信息http://jmeter.apache.org/usermanual/component_reference.html#Summary_Report

详细的网址报告。

报告包含有关URL的信息。

请注意,URL仅显示在生成的报告文件中(在GUI中,URL不显示)。

报告文件名称为{report_save_path} /detailed-urls-report.log(可以以CSV格式打开)。详细信息http://jmeter.apache.org/usermanual/component_reference.html#View_Results_in_Table

关于其他类型,请阅读http://jmeter.apache.org/usermanual/component_reference.html

性能优化工具

如果您的公司正在寻找专业的捷径工具来方便地缩短性能时间,那么Mageplaza乐于为我们的合作伙伴PotatoCommerce之一提供Magento 1&2商店的有用扩展之一,其中通过优化JS提高了速度,CSS和HTML内容。

相关文章

0 0 投票数
文章评分
订阅评论
提醒
0 评论
内联反馈
查看所有评论