linux_jmeter安装
Windows下的jmeter是GUI模式,可查看操作,但是GUI对性能的干扰比较大,所以一般压测会在Linux上运行。
安装步骤:
1.下载apache-jmeter-5.1.1.tgz,与windows的jmeter版本一致
2.上传至/opt,解压tar -xf apache-jmeter-5.1.1.tgz -C /usr/local/
3.配置环境变量
1)vim /etc/profile
2)添加变量
export JMETER_HOME=/usr/local/apache-jmeter-5.1.1
export CLASSPATH=$JMETER_HOME/lib/ext/ApacheJMeter_core.jar:$JMETER_HOME/lib/jorphan.jar:$JMETER_HOME/lib/logkit-2.0.jar:$CLASSPATH
export PATH=$JMETER_HOME/bin:$PATH:$HOME/bin
3)添加完成后,执行profile文件
[root@localhost apache-jmeter-5.1.1]# jmeter -v
执行jmx:
1) cd /usr/local/apache-jmeter-5.1.1目录下
新建test文件夹,再创建result子文件夹,将windows上的jmx脚本上传至test文件夹
命令./bin/jmeter -n -t test/13lesson0302.jmx -l test/test.jtl -e -o test/result/
2) 生成测试报告
可以将index.htm浏览器打开