本博文jmeter介紹的是在windows下使用,linux后期看情況更新,謝謝
簡單介紹,想更多了解的去官方,多的很:
The Apache JMeter™ application is open source software, a 100% pure Java application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.
What can I do with it?
Apache JMeter may be used to test performance both on static and dynamic resources, Web dynamic applications.
It can be used to simulate a heavy load on a server, group of servers, network or object to test its strength or to analyze overall performance under different load types.
Apache JMeter features include:
- Ability to load and performance test many different applications/server/protocol types:
- Web - HTTP, HTTPS (Java, NodeJS, PHP, ASP.NET, …)
- SOAP / REST Webservices
- FTP
- Database via JDBC
- LDAP
- Message-oriented middleware (MOM) via JMS
- Mail - SMTP(S), POP3(S) and IMAP(S)
- Native commands or shell scripts
- TCP
- Java Objects
- Full featured Test IDE that allows fast Test Plan recording (from Browsers or native applications), building and debugging.
- CLI mode (Command-line mode (previously called Non GUI) / headless mode) to load test from any Java compatible OS (Linux, Windows, Mac OSX, …)
- A complete and ready to present dynamic HTML report
- Easy correlation through ability to extract data from most popular response formats, HTML, JSON , XML or any textual format
- Complete portability and 100% Java purity.
- Full multi-threading framework allows concurrent sampling by many threads and simultaneous sampling of different functions by separate thread groups.
- Caching and offline analysis/replaying of test results.
- Highly Extensible core:
- Pluggable Samplers allow unlimited testing capabilities.
- Scriptable Samplers (JSR223-compatible languages like Groovy and BeanShell)
- Several load statistics may be chosen with pluggable timers.
- Data analysis and visualization plugins allow great extensibility as well as personalization.
- Functions can be used to provide dynamic input to a test or provide data manipulation.
- Easy Continuous Integration through 3rd party Open Source libraries for Maven, Gradle and Jenkins.
建議軟件大家都從官方下載,最新版,安全可靠值得信賴
基礎了解完了,開始下載吧,jmeter是純java的程序,需要java環境才能使用,所以先下載一個jdk
java的官方直接下載:https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
jmeter官方直接下載:https://jmeter.apache.org/download_jmeter.cgi
1、點擊下載
2、下載二進制的zip:
別問其他的是干啥的,我也不知道,下載zip就對了
下載完之后進行解壓 ,解壓之后是這個包:
不需要安裝,解壓之后直接使用,下面介紹一下每個文件夾的作用,為啥介紹,那肯定有用,萌新銘記呦
1、backups :備份,jmeter項目腳本
2、bin : 啟動文件和配置文件
(1)、ApacheJMeter.jar 啟動文件
(2)、jmeter.bat cmd 啟動文件,后台會開一個cmd窗口
(3)、jmeter.sh linux 啟動文件
(4)、jmeter.properties 系統配置文件
(5)、jmeter-server.bat windows 分布式測試 服務器配置
(6)、jmeter-server linux 分布式測試 服務器配置
3、docs : 接口文檔目錄
4、extras : 擴展插件目錄
5、lib : 用到的插件目錄,里面都是jar包,jmeter使用過程中會在lib和extras目錄下尋找需要的類
6、licenses : 證書目錄
7、printable_docs : 用戶使用手冊,大家自學不懂的時候也可以看里面文檔 (有不懂得可以多看看,挺不錯的,雖然版本有點老)
1、性能基本知識 - 先大概過一遍每個插件的大概含義,下面再開始進行性能或接口測試,請看另外博文
測試片段 - 控制器上的一個特殊的線程組,和線程組是一個層級,但是他是不被主動執行的 ,除非它是一個模塊控制器或者是被控制器引用才會執行
配置元件 - 用於對靜態數據配置的支持 ,如CSV,Data ,config可以將本地數據文件形成數據池
定時器 - 操作之間設置等待時間 ,多種類型定時器,后面可能會用到
前置處理器 - 用於實際的請求發出之前對即將發出的請求進行特殊處理,如HTTP ,URl 重寫修復符
后置處理器 - 對發出請求后得到的服務器響應進行處理,一般用來提取響應中的特定數據
斷言 - 用於檢測測試中得到的相應數據是否等於預期結果,設置檢查點 ,如果沒有滿足斷言則是失敗case
監聽器 - 用來對測試結果進行處理和可視化展示的一系列, 圖形結果,查看結果樹,聚合報告,都是常用的
取樣器 - 向服務器發送請求,根據不用協議有不用的取樣器
邏輯控制器 - 2類 ,一類是用於控制test plan中sampler節點發送請求的邏輯順序的控制器,一類是用來組織可控制sampler節點的!
用戶使用手冊里的分布式測試:
25. Apache JMeter Distributed Testing Step-by-step | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|