Apache JMeter™ 教程

栏目: 服务器 · Apache · 发布时间: 6年前

内容简介:github推特能够加载和性能测试许多不同的应用程序/服务器/协议类型:

介绍

github https://github.com/apache/jmeter

推特 https://twitter.com/ApacheJMeter 用于实时接收一些官方消息

能够加载和性能测试许多不同的应用程序/服务器/协议类型:

Web - HTTP,HTTPS(Java,NodeJS,PHP,ASP.NET,...)

SOAP / REST Web服务

FTP

数据库通过JDBC

LDAP

面向消息的中间件(MOM)通过JMS

邮件 - SMTP(S),POP3(S)和IMAP(S)

本机命令或 shell 脚本

TCP

Java对象

关于压力负载工具

neoload 使用云,可以进行微服务架构,IOT https://www.neotys.com/neoload/overview

Gatling 一款开源的负载测试 https://gatling.io/ 分为企业版,开源版两种 兼容 devops

这三款软件都会讲解

katalon studio 一款压力负载 工具 云端 基于 devops工具流 https://www.katalon.com/

个人推荐 katalon studio neoload 这两款软件 非常好用和devops工具流结合 可以对api, web , 移动端进行压力负载测试 针对katalon studio 也将会写一份教程

开源协议版本

https://www.apache.org/licenses/

Apache Software Foundation

一些教程

免费

YouTube

azure dev ops https://docs.microsoft.com/en-us/azure/devops/test/load-test/get-started-jmeter-test?view=azure-devops

收费

udemy https://www.udemy.com/topic/jmeter/

运行方式

使用 Azure DevOps 进行云端压力负载测试

使用 国内的腾讯云 阿里云进行云端负载测试

使用本地进行压力负载测试

腾讯云webtest 云端压力测试

https://cloud.tencent.com/product/lm

文档 https://cloud.tencent.com/document/product/653

将会以调用sdk为例

原则上 aws更好,不过需要付费

先进行本地的GUI压力负载测试

安装

➜  jmeter wget http://mirror.bit.edu.cn/apache//jmeter/binaries/apache-jmeter-5.1.1.zip
➜  jmeter unzip ./apache-jmeter-5.1.1.zip

启动GUI界面

建议 不要使用GUI进行测试..

应当使用命令行启动

➜  apache-jmeter-5.1.1 ls
bin  docs  extras  lib  LICENSE  licenses  NOTICE  printable_docs  README.md
➜  apache-jmeter-5.1.1 cd ./bin
➜  bin ls
ApacheJMeter.jar          jmeter.bat         mirror-server.sh
BeanShellAssertion.bshrc  jmeter-n.cmd       reportgenerator.properties
BeanShellFunction.bshrc   jmeter-n-r.cmd     report-template
BeanShellListeners.bshrc  jmeter.properties  saveservice.properties
BeanShellSampler.bshrc    jmeter-server      shutdown.cmd
create-rmi-keystore.bat   jmeter-server.bat  shutdown.sh
create-rmi-keystore.sh    jmeter.sh          stoptest.cmd
examples                  jmeter-t.cmd       stoptest.sh
hc.parameters             jmeterw.cmd        system.properties
heapdump.cmd              krb5.conf          templates
heapdump.sh               log4j2.xml         threaddump.sh
jaas.conf                 mirror-server      upgrade.properties
jmeter                    mirror-server.cmd  user.properties
➜  bin pwd 
/home/ming/jmeter/apache-jmeter-5.1.1/bin
➜  bin sudo chmod ./jmeter.sh
[sudo] ming 的密码: 
➜  bin sudo chmod +x  ./jmeter.sh
[sudo] ming 的密码: 
➜  bin ls
ApacheJMeter.jar          jmeter.bat         mirror-server.sh
BeanShellAssertion.bshrc  jmeter-n.cmd       reportgenerator.properties
BeanShellFunction.bshrc   jmeter-n-r.cmd     report-template
BeanShellListeners.bshrc  jmeter.properties  saveservice.properties
BeanShellSampler.bshrc    jmeter-server      shutdown.cmd
create-rmi-keystore.bat   jmeter-server.bat  shutdown.sh
create-rmi-keystore.sh    jmeter.sh          stoptest.cmd
examples                  jmeter-t.cmd       stoptest.sh
hc.parameters             jmeterw.cmd        system.properties
heapdump.cmd              krb5.conf          templates
heapdump.sh               log4j2.xml         threaddump.sh
jaas.conf                 mirror-server      upgrade.properties
jmeter                    mirror-server.cmd  user.properties
➜  bin sudo ./jmeter.sh 
================================================================================
Don't use GUI mode for load testing !, only for Test creation and Test debugging.
For load testing, use CLI Mode (was NON GUI):
   jmeter -n -t [jmx file] -l [results file] -e -o [Path to web report folder]
& increase Java Heap to meet your test requirements:
   Modify current env variable HEAP="-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m" in the jmeter batch file
Check : https://jmeter.apache.org/usermanual/best-practices.html
================================================================================

这里需要注意,由于jmetter 运行在jvm堆上,所以需要增加jvm的堆的大小,,用于创建更多的对象,用于进行负载测试

Apache JMeter™ 教程

Apache JMeter™ 教程

Apache JMeter™ 教程

构建web测试计划

添加线程组

创建五个用户,请求发送到jmetter上的2个页面,请求总数 (5个用户)x(1个请求)x(重复2次)= 10个HTTP请求

Apache JMeter™ 教程

添加取样器中的HTTP请求

Apache JMeter™ 教程

再次添加监听器,用于对结果进行展示

Apache JMeter™ 教程

运行 结果如下

Apache JMeter™ 教程


以上所述就是小编给大家介绍的《Apache JMeter™ 教程》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Pattern Recognition and Machine Learning

Pattern Recognition and Machine Learning

Christopher Bishop / Springer / 2007-10-1 / USD 94.95

The dramatic growth in practical applications for machine learning over the last ten years has been accompanied by many important developments in the underlying algorithms and techniques. For example,......一起来看看 《Pattern Recognition and Machine Learning》 这本书的介绍吧!

MD5 加密
MD5 加密

MD5 加密工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具