JMeter的下载以及安装使用
下载
https://jmeter.apache.org/download_jmeter.cgi
安装
无须安装,解压之后即可使用。
解压到C:\Program Files\apache-jmeter-5.1目录下(无法直接解压,先在D盘解压,然后复制到C盘里面)。
运行之后,一闪而过,没有出现UI。
需要注意的是:启动bat文件最好用管理员权限,否则我的使用路径是系统盘,会出现log文件不能写的问题
问题排查
注释掉jmeter.bat文件中的第一行,rem @echo off,然后运行如下命令,可以看到错误:
C:\Program Files\apache-jmeter-5.1\bin [master +0 ~1 -0 !]> .\jmeter.bat >>launch.log
java.lang.Throwable: Could not access C:\Program Files\apache-jmeter-5.1\lib
at org.apache.jmeter.NewDriver.<clinit>(NewDriver.java:105)
java.lang.Throwable: Could not access C:\Program Files\apache-jmeter-5.1\lib\ext
at org.apache.jmeter.NewDriver.<clinit>(NewDriver.java:105)
java.lang.Throwable: Could not access C:\Program Files\apache-jmeter-5.1\lib\junit
at org.apache.jmeter.NewDriver.<clinit>(NewDriver.java:105)
java.lang.ClassNotFoundException: org.apache.jmeter.JMeter
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.apache.jmeter.NewDriver.main(NewDriver.java:250)
JMeter home directory was detected as: C:\Program Files\apache-jmeter-5.1
解决:发现是lib文件夹没有复制成功导致的,之前复制文件夹的时候,提示lib被占用。所以没有复制成功。
PluginsManager
https://jmeter-plugins.org/wiki/PluginsManager/
安装
https://jmeter-plugins.org/install/Install/
The easiest way to get the plugins is to install Plugins Manager. Then you'll be able to install any other plugins just by clicking a checkbox.
proxy
Plugins Manager respects JMeter's proxy settings. However, to avoid editing the properties files, we recommend to launch JMeter with additional parameters to pass it the proxy settings:
JVM_ARGS="-Dhttps.proxyHost=myproxy.com -Dhttps.proxyPort=8080" jmeter\bin\jmeter.bat
If you need proxy username/password, specify them with two additional properties http.proxyUser and http.proxyPasslike this:
JVM_ARGS="-Dhttps.proxyHost=myproxy.com -Dhttps.proxyPort=8080 -Dhttp.proxyUser=john -Dhttp.proxyPass=***" jmeter\bin\jmeter.bat
在system.properties文件中配置代理
So if you don't wish to set both http and https proxies, you can define the relevant properties in system.properties instead of using the command-line parameters.
https://stackoverflow.com/questions/52084212/how-to-manage-proxy-in-jmeter
You can configure JMeter to use proxy in 2 ways:
-
jmeter -H your_proxy_host -P your_proxy_port
-
Using system.properties (the file lives under "bin" folder of your JMeter installation, add the next lines to it:
http.proxyHost=your_proxy_host http.proxyPort=your_proxy_port https.proxyHost=your_proxy_host https.proxyPort=your_proxy_port
JMeter restart will be required to pick the properties up.
需要注意的是,http.proxyHost=http:// 这里需要加http://
unable to find valid certification path to requested target
https://www.cnblogs.com/chucklu/p/10445580.html
在jmeter.properties配置
# CookieManager behaviour - should Cookies be stored as variables?
# Default is false
CookieManager.save.cookies=true
407错误,代理需要授权
给代理配置上账户,这里的账号和密码。密码如果有特殊字符,需要先进行一次urlencode【密码中的@会被转换成%40】
http://账号:密码@域名(ip):端口号
总结
- 使用的proxy必须加上http://的前缀
- 使用的proxy必须配置账户和密码
建议在bin\ system.properties文件末尾添加如下两行
http.proxyHost=http://域账号:密码(url encode之后的) @proxy:port
http.proxyPort=8080
- 导出https://jmeter-plugins.org/网站的证书
参考https://blog.csdn.net/c5113620/article/details/80384660
- 将证书导入Java的证书验证系统(Java的证书验证系统是独立于操作系统和浏览器的,而是使用JRE中证书库,所有必须把代理工具的证书加入到JRE的证书库中。)
https://blog.csdn.net/write_down/article/details/79114573
https://www.blazemeter.com/blog/how-to-configure-jmeter-logging
作者:Chuck Lu GitHub |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2018-02-27 如何注释ascx中的代码
2016-02-27 怎么查询数据库中第30到40条记录呢? 通过ID,查询当前第30-40条记录 注意,ID不是顺序的
2015-02-27 List<T> please check srcIndex
2015-02-27 Form.ShowDialog和Form.DialogResult