Child pages
  • Configure LoadGenerator When Using JMeter
Skip to end of metadata
Go to start of metadata


Using jmeter, automatically fetches LoadGenerator duration timestamps from the jmeter generated output files. LoadGenerator logs the jmeter running duration in the form of CSV and xml files.

Note: Generate the output file in the current build directory through the pipeline script that is executed before the CA APM jenkins plugin. The pipeline script automatically generates the CSV or XML output file in the current build directory of the job, inside jenkins workspace. Ensure that the CSV or XML file name that you use in the pipeline script is jmeterOutput.<csv/xml>

Generate the Output File

You can generate the HTML output using CSV or XML file as input. The generated JMeter output file is available in the current build number directory. The benchmark output file is available in the benchmark build number directory, generated when the benchmark build was ran in the past.

Include the following properties in the properties files for CSV:

Sample Output Property Configuration

#name of loadgenerator for jmeter
loadgenerator.name=jmeter
#output filetype of jmeter, it can be csv/xml
jmeter.filetype=

Note: The file with the same extension should be available in the benchmark build directory. e.g., if we use filetype as csv for current build, the benchmark build directory should also have the jmeter generated output file of type csv.

Modify the Pipeline Script to Generate CSV Output

Add the following stage to the Jenkins pipeline script before the CAAPMPerformanceComparator stage.

stage("JMeter")
{ 
steps{
   sh "${env.WORKSPACE}\\<jmeter_home>\\bin\\jmeter.sh -n -t <jmx_file_path> -l ${env.WORKSPACE}\\${BUILD_NUMBER}\\jmeterOutput.csv"
  }
}

Note: The ${env.WORKSPACE} is the Jenkins job directory name.

Modify the Pipeline Script to Generate XML Output

Add the following stage to the Jenkins pipeline script before the CAAPMPerformanceComparator stage.

stage("JMeter")
{ 
  steps{
    sh"${env.WORKSPACE}\\<jmeter_home>\\bin\\jmeter.sh -Jjmeter.save.saveservice.output_format=xml -n -t  <jmx_file_path> -l ${env.WORKSPACE}\\${BUILD_NUMBER}\\jmeterOutput.xml" 
 }
}

Note: The ${env.WORKSPACE} is the Jenkins job directory name.

  • No labels