'Setup & Execution of Jmeter Distributed Test run from Jenkins

i'm looking for some assistance in execution of Jmeter distributed test runs using Jenkins hosted on Windows platform.

I need to know how to

  1. Start Jmeter master/slave agents (jmeter-server.bat) from Jenkins machine.
  2. how to stop the above process once the test run completes.


Solution 1:[1]

A hint: if you don't "stop the above process once the test run completes" you won't have to "start" them.

If you want to control everything from Jenkins you need to install Jenkins agent process on each machine you intend to use as JMeter slave, see Step by step guide to set up master and agent machines on Windows Jenkins wiki page for more details.

Once done you can create a job which will start JMeter processes using simple "Execute windows batch command" step on the agent machines

With regards to your point 2 - it's sufficient to set server.exitaftertest JMeter property to true on slave machines in any convenient way, i.e. by adding -J command-line argument like:

jmeter-server.bat -Jserver.exitaftertest=true 

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dmitri T