当前位置:网站首页>What is Jmeter? What are the principle steps used by Jmeter?
What is Jmeter? What are the principle steps used by Jmeter?
2022-08-10 22:05:00 【Rejoice in the testing world】
1.1 什么是 JMeter
Apache JMeter 是 Apache 组织开发的基于 Java 的压力测试工具.用于对软件做压力测试,它最初被设计用于 Web 应用测试,但后来扩展到其他测试领域. 它可以用于测试静态和动态资源,例如静态文件、Java 小服务程序、CGI 脚本、Java 对象、数据库、FTP 服务器, 等等.JMeter 可以用于对服务器、网络或对象模拟巨大的负载,来自不同压力类别下测试它们的强度和分析整体性能.另外,JMeter 能够对应用程序做功能/回归测试,通过创建带有断言的脚本来验证你的程序返回了你期望的结果.为了最大限度的灵活性,JMeter 允许使用正则表达式创建断言.
Apache jmeter 可以用于对静态的和动态的资源(文件,Servlet,Perl 脚本,java 对象,数据库和查询,FTP 服务器等等)的性能进行测试.它可以用于对服务器、网络或对象模拟繁重的负载来测试它们的强度或分析不同压力类型下的整体性能.你可以使用它做性能的图形分析或在大并发负载测试你的服务器/脚本/对象.
1.2 为什么是 JMeter
为什么选择 JMeter,下面看看 JMeter 的特色.
开源许可: Jmeter 是完全免费的,并提供了源码可供自定义开发
图形界面模式:提供了方便的图形界面来编辑和开发测试脚本
平台无关:可以轻易在 windows、linux、mac 上运行
多线程框架:通过线程组,Concurrent users to easily set different test.
图形测试结果:提供了图表、表格、树、文件等格式的结果显示.
易于安装:jmeter 不需要安装,下载解压即可用.
高扩展性:jmeter 支持用户自定义测试脚本,同样还提供了各种插件.
多测试类型支持:支持性能测试、分布式测试、功能测试
仿真模拟:支持多用户并发测试
多协议支持:支持 http、jdbc、ldap、soap、jms、ftp 等等协议
录制&回放:支持用 badboy 或 jmeter 录制
脚本测试:jmeter 支持 beanshell 和 selenium
1.3 JMeter 工作原理
JMeter 基本工作原理如图:
JMeter 完整的工作原理如图:
1.4 总结
本次对 jmeter 进行了简单的基本介绍,主要让大家对 jmeter 有个基本的了解.
第二篇 JMeter 目录及关键配置分析
2.1 前言
Learn a tool,Must first key to its configuration and directory has a basic understanding of,This can more easily in-depth grasp the tool,下面我们就 JMeter Directory and related key configuration analysis shows that.
2.2 下载安装
1.安装主程序
从 Apache JMeter Website under the latest version:
http://jmeter.apache.org/download_jmeter.cgi
下载后直接解压即可.
2.安装插件管理
从
https://jmeter-plugins.org/install/Install/ 或 https://jmeter-plugins.org/downloads/all/ Download the plugin management package,如图:
Put to the download package jmemter Extract the root of lib/ext After the restartjmeter即可.
2.3 目录说明
First look at the decompression after JMeter 安装目录:
目录说明:
backups: 包含jmeterAutomatic backup save to test plan
bin: 包含启动、配置等相关命令
docs: 官方本地文档目录
extras: 辅助库
lib: 核心库,包含 JMeter 用到的各种基础库和插件
licenses: 包含 non-ASF 软件的许可证
printable_docs: 可打印版本文档目录
LICENSE: JMeter 许可说明
NOTICE: JMeter 简单信息说明
README.md: JMeter 官方基本介绍
下面我们重点看下 bin 目录,如图:
主要介绍 bin We pay most attention to several files directory:
jmeter.properties: JMeter 核心配置文件,各种配置基本在这完成
log4j.conf: JMeter 日志配置管理
jmeter.log: JMeter 运行日志记录,什么输出信息、警告、报错都在这里进行了记录
jmeter.bat: windows 下 jmeter 启动文件
shutdown.cmd: windows 下 jmeter 关闭文件
stoptest.cmd: windows 下 jmeter 测试停止文件
jmeter-server.bat: windows 下 jmeter 服务器模式启动文件
注:每一个.cmd 文件都对应一个.sh 文件,.sh 是 linux Under the corresponding function of file,The function of the other files are not say clear,At the same time other elaborates the directory is no longer here,Interested can thorough look at yourself.
2.4 关键配置说明
1.jmeter.properties 配置说明
Mainly includes the following aspects of configuration:
SSL 配置:
重点关注下面几个配置
# 指定 HTTPS 协议层
https.default.protocol=TLS
# 指定 SSL 版本,实际应用中可能需要修改
https.default.protocol=SSLv3
# 设置启动的协议
https.socket.protocols=SSLv2Hello SSLv3 TLSv1
# 缓存控制,控制 SSL 是否可以在多个迭代中重用
https.use.cached.ssl.context=true
JMeter Interface display configuration
Here is not the interface shows the display control of,Usually the default interface can meet all application.
JMeter 测试项目自动备份配置
# 设置是否启用自动备份,默认是 true
jmeter.gui.action.save.backup_on_save=true
# 设置自动备份目录,默认备份至 JMeter 根目录的 backups下
jmeter.gui.action.save.backup_directory=
# 设置自动备份项目数,默认为最近 10 个
jmeter.gui.action.save.keep_backup_max_count=10
远程主机配置
# 配置远程主机的 IP,默认为本机.用逗号","可以设置多个远程主机
remote_hosts=127.0.0.1
# 多个远程主机指定示例如下,其中:后为端口
remote_hosts=127.0.0.1:1099,127.0.0.1:1200,127.0.0.1:1300
对于 RMID 的配置请直接看配置文件中的选项说明
日志管理配置
# 设置日志格式
log_format_type=default
# 设置日志输出级别
log_level.jmeter=INFO
# 设置 junit 日志输出级别
log_level.jmeter.junit=DEBUG
# 设置日志输出目标文件,默认为 jmeter.log
log_file=jmeter.log
And so on other 10 Multiple configuration categories(就不一一列举了)
jmeter.bat 关键配置修改
为了更优化的使用 jmeter,需要对 jmeter.bat 中的一些配置根据当前机器的配置进行优化,这里进行关键配置项说明,找到这些配置,对其中的数值根据当前机器的硬件配置来修改.
set HEAP=-Xms2048m -Xmx2048m
set NEW=-XX:NewSize=512m -XX:MaxNewSize=512m
set SURVIVOR=-XX:SurvivorRatio=8 -
XX:TargetSurvivorRatio=50%
set TENURING=-XX:MaxTenuringThreshold=2
if %current_minor% LEQ "8" (
rem Increase MaxPermSize if you use a lot of Javascript in
your Test Plan :
set PERM=-XX:PermSize=512m -
XX:MaxPermSize=1024m
)
2.5 启动 jmeter
在 bin 目录下直接双击 jmeter.bat 即可
启动后的界面如下:
2.6 总结
本次就 jmeter The installation and configuration and key configuration items to share,You can go to study in-depth the other configuration,In order to further familiar with jmeter 的原理和应用.
喜欢软件测试的小伙伴们,如果我的博客对你有帮助、如果你喜欢我的博客内容,请 “点赞” “评论” “收藏” 一 键三连哦!
软件测试工程师自学教程:
这才是2022最精细的自动化测试自学教程,我把它刷了无数遍才上岸字节跳动,做到涨薪20K【值得自学软件测试的人刷】
软件测试工程师月薪2W以上薪资必学技能 — Python接口自动化框架封装.
美团面试真题_高级测试25K岗位面试 — 软件测试人都应该看看
软件测试必会_Jmeter大厂实战 — 仅6步可实现接口自动化测试
边栏推荐
- 【PCBA scheme design】Bluetooth skipping scheme
- 力扣221题,最大正方形
- 使用 Cloudreve 搭建私有云盘
- Shell编程之条件语句(二)
- Black cat takes you to learn Makefile Part 12: Summary of common Makefile problems
- DDL:CREATE 创建数据库——《mysql 从入门到内卷再到入土》
- PPT的两个实用技巧
- FPGA - 7系列 FPGA内部结构之Memory Resources -03- 内置纠错功能
- Huawei router clock near the drainage experiment (using stream strategy)
- 什么是Jmeter?Jmeter使用的原理步骤是什么?
猜你喜欢
阿里巴巴、蚂蚁集团推出分布式数据库 OceanBase 4.0,单机部署性能超 MySQL
ACM模板笔记:最长不下降/上升子序列
Shell编程规范与变量
TCL:事务的特点,语法,测试例——《mysql 从入门到内卷再到入土》
shell脚本循环语句for、while语句
QT笔记——用VS + qt 生成dll 和 调用生成的dll
交换机和生成树知识点
Redis 性能影响 - 异步机制和响应延迟
An article to teach you a quick start and basic explanation of Pytest, be sure to read
ThreadLocal comprehensive analysis (1)
随机推荐
web逆向之丁香园
String类的常用方法
shell编程之免交互
黑猫带你学Makefile第13篇:Makefile编译问题合集
直播课堂系统08-腾讯云对象存储和课程分类管理
labelme-5.0.1版本编辑多边形闪退
MySQL Advanced Commands
c语言之 练习题1 大贤者福尔:魔法数,神奇的等式
uni-app微信小程序——下拉多选框
每次打开chrome会跳出What's new
UPDATE:修改数据语法使用例——《mysql 从入门到内卷再到入土》
Translating scientific and technological papers, how to translate from Russian to Chinese
CGO Preliminary Cognition and Basic Data Type Conversion
JVM经典五十问,这下面试稳了
2022.8.8 Selected Lectures on Good Topics (Number Theory Field)
ACM解题笔记——HDU 1401 Solitaire(DBFS)
一篇文章教你Pytest快速入门和基础讲解,一定要看
Live Classroom System 08-Tencent Cloud Object Storage and Course Classification Management
Extended Chinese Remainder Theorem
unusual understanding