151-java-performance-jmeter

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Run performance tests based on JMeter

基于JMeter运行性能测试

Provide a complete JMeter performance testing solution by creating the run-jmeter.sh script from the exact template, making it executable, and configuring the project structure for load testing. Supports custom loops, threads, ramp-up, and environment variable overrides.
What is covered in this Skill?
  • Create run-jmeter.sh in project root from the exact template (no modifications)
  • Project structure: src/test/resources/jmeter/load-test.jmx, target/ for results
  • Script options: -l (loops), -t (threads), -r (ramp-up), -g (GUI), -h (help)
  • Environment variables: JMETER_LOOPS, JMETER_THREADS, JMETER_RAMP_UP
  • Verify JMeter is installed and available before proceeding
Scope: Copy the script template verbatim. Do not modify, interpret, or enhance the template content.
通过从精确模板创建run-jmeter.sh脚本、设置其可执行权限,并配置用于负载测试的项目结构,提供完整的JMeter性能测试解决方案。支持自定义循环次数、线程数、加速时间以及环境变量覆盖。
本Skill涵盖哪些内容?
  • 从精确模板在项目根目录创建run-jmeter.sh脚本(不做任何修改)
  • 项目结构:src/test/resources/jmeter/load-test.jmx,结果存储在target/目录
  • 脚本选项:-l(循环次数)、-t(线程数)、-r(加速时间)、-g(GUI模式)、-h(帮助)
  • 环境变量:JMETER_LOOPS、JMETER_THREADS、JMETER_RAMP_UP
  • 在执行前验证JMeter已安装且可用
范围: 完全复制脚本模板,不得修改、解读或扩展模板内容。

Constraints

约束条件

JMeter must be installed and available in PATH. If not available, show a message and exit. Use only the exact template for the run-jmeter.sh script.
  • PREREQUISITE: Verify JMeter is installed and accessible via
    jmeter --version
    before creating the script
  • CRITICAL: Copy the run-jmeter.sh template exactly — do not modify, interpret, or enhance
  • PERMISSION: Make the script executable with
    chmod +x run-jmeter.sh
  • BEFORE APPLYING: Read the reference for the exact script template and usage instructions
JMeter必须已安装且在PATH中可用。如果不可用,显示提示信息并退出。仅使用run-jmeter.sh脚本的精确模板。
  • 前提条件:在创建脚本前,通过
    jmeter --version
    验证JMeter已安装且可访问
  • 关键要求:完全复制run-jmeter.sh模板——不得修改、解读或扩展
  • 权限设置:使用
    chmod +x run-jmeter.sh
    设置脚本可执行权限
  • 应用前须知:阅读参考文档获取精确的脚本模板和使用说明

When to use this skill

何时使用本Skill

  • Improve the code with JMeter performance testing
  • Apply JMeter performance testing
  • Refactor the code with JMeter performance testing
  • Add JMeter support
  • 为代码添加JMeter性能测试
  • 应用JMeter性能测试
  • 结合JMeter性能测试重构代码
  • 添加JMeter支持

Reference

参考文档

For detailed guidance, examples, and constraints, see references/151-java-performance-jmeter.md.
如需详细指南、示例和约束条件,请参阅references/151-java-performance-jmeter.md