Skip to content

Instantly share code, notes, and snippets.

@helephant
Last active May 13, 2019 10:42
Show Gist options
  • Save helephant/626dc637b8158820af9479b23a440bb4 to your computer and use it in GitHub Desktop.
Save helephant/626dc637b8158820af9479b23a440bb4 to your computer and use it in GitHub Desktop.

jmeter -Jthreads=10 -n -t ./my-test.jmx -l my-test-log.jtl -o my-test-output.csv

Useful CLI arguments

  • -n: don't launch the GUI
  • -t: location of the test script
  • -o: location of an output file
  • -l: location of a detailed log file

Overriding script variables from the CLI

There are a few different ways to override variables in your JMeter script with environment or run specific values.

On the command-line, you can pass in a property override with this format -J[prop_name]=[value]

jmeter -Jthreads=10 -n -t ./my-test.jmx -l my-test-log.jtl -o my-test-output.csv

You can also create a property file with a bunch of properties to override.

Generate aggregates

JMeter can generate a report that creates an aggregated view for each uniquely named thread in your test. It contains things like number of requests, total time, average time.

  • Find apache-jmeter-5.1.1/bin/PluginsManagerCMD.sh on the filesystem
  • Install command-line graph plotting tool plugin (you can download the .jar or install it through the plugin manager)

PluginsManagerCMD.sh --tool Reporter --generate-csv my-test-aggregate-report.csv --input-jtl my-test-log.jtl --plugin-type AggregateReport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment