Java 压力测试工具 JMeter 的使用
JMeter是Apache基金会开发的一款开源性能测试工具,主要用于对Web应用和其他服务(如数据库、FTP、REST API等)进行负载测试、压力测试和功能测试。它采用Java编写,支持多协议测试,可通过线程组模拟并发用户行为,内置HTTP请求、JDBC等取样器,并提供监听器展示测试结果。JMeter支持插件扩展,适合自动化集成,但大规模测试时需切换至非GUI模式提升性能。其优势在于免费开源、跨平台,但学习曲线较陡,适合中高级测试人员使用。

https://github.com/apache/jmeter
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 可用于测试静态和动态资源、Web动态应用程序的性能。
它能够模拟服务器、服务器组、网络或对象上的重负载,以测试其强度或分析在不同负载类型下的整体性能。
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 is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
JMeter并非浏览器,它在协议层面工作。就Web服务和远程服务而言,JMeter表现得像一个浏览器(或者说多个浏览器);然而JMeter并不执行浏览器支持的所有操作。具体而言,JMeter不会执行HTML页面中的JavaScript代码,也不会像浏览器那样渲染HTML页面(虽然可以查看HTML格式的响应等,但这些时间不计入任何样本,且每次仅显示单个线程中的一个样本)。
更多推荐


所有评论(0)