modules/teamcityExtensions/MetaRunners/PSCI_JMeterWait.xml

<?xml version="1.0" encoding="UTF-8"?>
<meta-runner name="PSCI: JMeter wait">
  <description>Waits until JMeter process finishes and ensures it succeeded.</description>
  <settings>
    <parameters>
      <param name="jmeter.rootPath" value="" spec="text description='Path to root JMeter directory' label='Path to JMeter' display='normal'" />
      <param name="jmeter.jtlFile" value="" spec="text description='Path to the JMeter JTL file (output)' validationMode='not_empty' label='Path to JTL file' display='normal'" />
      <param name="jmeter.timeToWait" value="7200" spec="text description='Timeout (in seconds) for JMeter process. After this time the process will be killed and the build will fail.' validationMode='any' label='Time to wait' display='normal'" />
      <param name="jmeter.port" value="4445" spec="text description='The port where jmeter in non-GUI mode is listening on.' validationMode='regex' regexp='\d*' label='JMeter port' display='normal'" />
      <param name="jmeter.shutdownmode" value="SendShutdownMessage" spec="select label_1='Kils JMeter process explicitly' data_1='KillProcess' label_2='Run the Shutdown client to stop a non-GUI instance gracefully' data_2='SendShutdownMessage' label_3='Run the Shutdown client to stop a non-GUI instance abruptly' data_3='SendStopTestNowMessage' display='normal' label='Shutdown mode'" />
      <param name="jmeter.timeToWaitBeforeForceKill" value="60" spec="text description='Timeout (in seconds) for force-quitting JMeter process if `'Time to wait`' is exceeded. After this time the process will be killed immediately and the build will fail.' validationMode='any' label='Time to wait' display='normal'" />
      <param name="jmeter.enabled" value="true" spec="text description='Put false if this whole step should not run.' validationMode='any' label='Enabled' display='normal'" />
    </parameters>
    <build-runners>
      <runner name="Wait for JMeter" type="jetbrains_powershell">
        <parameters>
          <param name="jetbrains_powershell_bitness" value="x86" />
          <param name="jetbrains_powershell_execution" value="PS1" />
          <param name="jetbrains_powershell_minVersion" value="4.0" />
          <param name="jetbrains_powershell_script_code"><![CDATA[if ('%jmeter.enabled%' -and '%jmeter.enabled%' -ine 'true') {
  Write-Host "jmeter.enabled is set to %jmeter.enabled% - skipping."
  exit 0
}
. c:\PSCI\Boot\PSCI.boot.ps1
$ErrorActionPreference = "Stop"
try {
[void](Wait-JMeter -JMeterPidFile 'jmeter-pid.txt' `
-JtlOutputFile '%jmeter.jtlFile%' `
-StdOutFile 'jmeter-stdout.txt' `
-StdErrFile 'jmeter-stderr.txt' `
-TimeoutInSeconds '%jmeter.timeToWait%' `
-ForceKillTimeoutInSeconds '%jmeter.timeToWaitBeforeForceKill%' `
-JMeterDir '%jmeter.rootPath%' `
-ShutdownMode '%jmeter.shutdownmode%' `
-JMeterNonGUIPort '%jmeter.port%' `
-KillAfterTimeout)
} catch {
  Write-ErrorRecord
}]]></param>
          <param name="jetbrains_powershell_script_mode" value="CODE" />
          <param name="teamcity.step.mode" value="default" />
        </parameters>
      </runner>
    </build-runners>
    <requirements />
  </settings>
</meta-runner>