Jmeter-Maven-Plugin高级应用:Remote Server Configuration

Remote Server Configuration

Remote Start And Stop Of Servers Via <remoteConfig>

Setting the <startServersBeforeTests> option will result in a --runremote command being send to JMeter which will start up any remote servers you have defined in your jmeter.propertieswhen your first test starts.

Setting the <stopServersAfterTests> option will result in a --remoteexit command being send to JMeter which will shut down all remote servers defined in jmeter.properties after your last test has been run.

<startServersBeforeTests> and <stopServersAfterTests> can be used independantly so that it is possible to use another process to start and stop servers if required.

+---+
<project>
    [...]
        <build>
            <plugins>
                <plugin>
                    <groupId>com.lazerycode.jmeter</groupId> <artifactId>jmeter-maven-plugin</artifactId> <version>2.0.3</version> <executions> <execution> <id>jmeter-tests</id> <goals> <goal>jmeter</goal> </goals> </execution> </executions> <configuration> <remoteConfig> <startServersBeforeTests>true</startServersBeforeTests> <stopServersAfterTests>true</stopServersAfterTests> </remoteConfig> </configuration> </plugin> </plugins> </build> [...] </project> +---+

You can configure the plugin to perform a remote start and stop for each individual test by setting the <startAndStopServersForEachTest> variable to true. If you set this along with<startServersBeforeTests> and <stopServersAfterTests> the <startServersBeforeTests>and <stopServersAfterTests> settings will be ignored.

+---+
<project>
    [...]
        <build>
            <plugins>
                <plugin>
                    <groupId>com.lazerycode.jmeter</groupId> <artifactId>jmeter-maven-plugin</artifactId> <version>2.0.3</version> <executions> <execution> <id>jmeter-tests</id> <goals> <goal>jmeter</goal> </goals> </execution> </executions> <configuration> <remoteConfig> <startAndStopServersForEachTest>false</startAndStopServersForEachTest> </remoteConfig> </configuration> </plugin> </plugins> </build> [...] </project> +---+

Instead of starting all remote servers, you can specify which ones to start by using the<serverList> option, this will accept a comma separated list of servers for JMeter to start (these must be defined in your jmeter.properties, see the remote testing page in the JMeter manual).

+---+
<project>
    [...]
        <build>
            <plugins>
                <plugin>
                    <groupId>com.lazerycode.jmeter</groupId> <artifactId>jmeter-maven-plugin</artifactId> <version>2.0.3</version> <executions> <execution> <id>jmeter-tests</id> <goals> <goal>jmeter</goal> </goals> </execution> </executions> <configuration> <remoteConfig> <startServersBeforeTests>true</startServersBeforeTests> <serverList>server1,server2</serverList> <stopServersAfterTests>true</stopServersAfterTests> </remoteConfig> </configuration> </plugin> </plugins> </build> [...] </project>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值