需要分步指南在 Jenkins(使用 Hudson 构建)中通过 Ubuntu 执行 Jmeter 脚本 [英] Need Step by Step Guide to execute the Jmeter Scripts in Jenkins (with Hudson build) over Ubuntu

查看:14
本文介绍了需要分步指南在 Jenkins(使用 Hudson 构建)中通过 Ubuntu 执行 Jmeter 脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Jenkins (Hudson Build) 的新手.

我不知道如何将 Jmeter 脚本与安装在 Ubuntu 上的 Jenkins 集成.

我研究了很多,但我只能找到 Jenkins 基于 GUI 的步骤.

任何人都可以通过命令行步骤帮助我将 JmeterJenkins 集成吗?我需要将 Jmeter 集成为一项单独的任务.

我正在通过 Putty 和 Winscp 使用 EC2 实例.

解决方案

JMeter 至少有 3 个关于非 GUI 执行的选项,Jenkins 都支持:

  1. JMeter Ant 任务
  2. JMeter Maven 插件
  3. 命令行非 GUI 启动选项

请随意选择您最满意的那个.

最后一个是捆绑的,不需要任何 3rd 方软件或额外配置.

只需执行 JMeter 如下:

./jmeter.sh -n -t ${path to your .jmx script} -l ${path to your results file}

以防万一 - 完整的命令行选项:

<块引用>

 -h, --help打印使用信息并退出-v, --version打印版本信息并退出-p, --propfile <参数>要使用的 jmeter 属性文件-q, --addprop <参数>额外的 JMeter 属性文件-t, --testfile <参数>要运行的 jmeter 测试(.jmx)文件-l, --logfile <参数>将样本记录到的文件-j, --jmeterlogfile <参数>jmeter 运行日志文件 (jmeter.log)-n, --nongui在 nongui 模式下运行 JMeter-s, --server运行 JMeter 服务器-H, --proxyHost <参数>为 JMeter 设置代理服务器以使用-P, --proxyPort <参数>设置 JMeter 使用的代理服务器端口-N, --nonProxyHosts <参数>设置非代理主机列表(例如 *.apache.org|localhost)-u, --username <参数>为 JMeter 使用的代理服务器设置用户名-a, --password <参数>为 JMeter 使用的代理服务器设置密码-J, --jmeterproperty <参数>=<值>定义额外的 JMeter 属性-G, --globalproperty <参数>=<值>定义全局属性(发送到服务器)例如-Gport=123或 -Gglobal.properties-D, --systemproperty <参数>=<值>定义附加系统属性-S, --systemPropertyFile <参数>附加系统属性文件-L, --loglevel <参数>=<值>[类别=]级别例如jorphan=INFO 或 jmeter.util=DEBUG-r, --runremote启动远程服务器(在 remote_hosts 中定义)-R, --remotestart <参数>启动这些远程服务器(覆盖 remote_hosts)-d, --homedir <参数>要使用的 jmeter 主目录-X, --remoteexit在测试结束时退出远程服务器(非 GUI)

I'm new to Jenkins (Hudson Build).

I don't have any Idea how to integrate the Jmeter script with Jenkins installed over Ubuntu .

I researched a lot, but I could find only the GUI based steps for Jenkins.

Can any one please help me with Command line steps to integrate Jmeter with Jenkins? I need to integrate the Jmeter as a sepearte task .

I'm using EC2 instance through Putty and Winscp .

解决方案

JMeter has at least 3 options on how non-GUI execution, all of them are supported by Jenkins:

  1. JMeter Ant Task
  2. JMeter Maven Plugin
  3. Command line non-GUI launch option

Feel free to choose the one, you're most comfortable with.

The last one is bundled and doesn't require any 3rd party software or extra configuration.

Just execute JMeter as follows:

./jmeter.sh -n -t ${path to your .jmx script} -l ${path to your results file}

Just in case - full command line options:

    -h, --help
            print usage information and exit
    -v, --version
            print the version information and exit
    -p, --propfile <argument>
            the jmeter property file to use
    -q, --addprop <argument>
            additional JMeter property file(s)
    -t, --testfile <argument>
            the jmeter test(.jmx) file to run
    -l, --logfile <argument>
            the file to log samples to
    -j, --jmeterlogfile <argument>
            jmeter run log file (jmeter.log)
    -n, --nongui
            run JMeter in nongui mode
    -s, --server
            run the JMeter server
    -H, --proxyHost <argument>
            Set a proxy server for JMeter to use
    -P, --proxyPort <argument>
            Set proxy server port for JMeter to use
    -N, --nonProxyHosts <argument>
            Set nonproxy host list (e.g. *.apache.org|localhost)
    -u, --username <argument>
            Set username for proxy server that JMeter is to use
    -a, --password <argument>
            Set password for proxy server that JMeter is to use
    -J, --jmeterproperty <argument>=<value>
            Define additional JMeter properties
    -G, --globalproperty <argument>=<value>
            Define Global properties (sent to servers)
            e.g. -Gport=123                                                                                                                                             
             or -Gglobal.properties                                                                                                                                     
    -D, --systemproperty <argument>=<value>                                                                                                                             
            Define additional system properties                                                                                                                         
    -S, --systemPropertyFile <argument>
            additional system property file(s)
    -L, --loglevel <argument>=<value>
            [category=]level e.g. jorphan=INFO or jmeter.util=DEBUG
    -r, --runremote
            Start remote servers (as defined in remote_hosts)
    -R, --remotestart <argument>
            Start these remote servers (overrides remote_hosts)
    -d, --homedir <argument>
            the jmeter home directory to use
    -X, --remoteexit
            Exit the remote servers at end of test (non-GUI)

这篇关于需要分步指南在 Jenkins(使用 Hudson 构建)中通过 Ubuntu 执行 Jmeter 脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆