zoukankan      html  css  js  c++  java
  • 【转】Jmeter在命令行运行技巧

    For non-interactive testing, you may choose to run JMeter without the GUI. To do so, use the following command options
      -n This specifies JMeter is to run in non-gui mode
      -t [name of JMX file that contains the Test Plan].
      -l [name of JTL file to log sample results to].
      -r Run all remote servers specified in JMeter.properties (or remote servers specified on command line by overriding properties)
      The script also lets you specify the optional firewall/proxy server information:
      -H [proxy server hostname or ip address]
      -P [proxy server port]
      Example : JMeter -n -t my_test.jmx -l log.jtl -H my.proxy.server -P 8000
      -n 该参数表示Jmeter运行在非图形化模式下(即命令行模式)。
      -t 保存有测试用例的JMX文件
      -l 保存样本结果的JTL文件
      -r 运行所有在JMeter.properties 中定义的远程服务(或者通过命令行覆盖配置文件中定义的远程服务)。脚本还允许您指定可选的防火墙/代理服务器信息:
      -H 代理服务器主机名或者IP地址
      -P 代理服务器的端口号
      上面这段说明来自 JMeter 的官方用户手册。其中提到了使用命令行方式运行 JMeter 脚本的方法。只有几个简单的参数,很直观,用起来也很方便。好处是可以节省一些系统资源。
      今天尝试 300 个虚拟用户连续运行 5 分钟时——使用 GUI 方式,发现开始运行后不久 UI 就失去了响应,并提示一个有关  AWT 的错误,最终只能把 Java 进程结束掉。但是使用命令行方式时却很稳定。
      不过当在命令行方式下尝试 500 个虚拟用户连续运行 5 分钟时,JMeter 抛出了一个 Out of Memory 的异常并退出了进程。
      Note:
      1.执行命令前要检查当前目录是否是 %JMeter_Home%in 目录;
      2.如果 JMeter 脚本不在当前目录,需要指定完整的路径;如果要把执行的结果保存在其他地方也要指定完整的路径。
  • 相关阅读:
    失格
    救赎
    篝火晚会
    旅行家的预算
    荒诞
    mod
    clique
    序列
    [CF932E]Team Work & [BZOJ5093]图的价值
    NOIWC2018游记
  • 原文地址:https://www.cnblogs.com/blongfree/p/4980826.html
Copyright © 2011-2022 走看看