Difference between revisions of "Apache JMeter"

From Ever changing code
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 4: Line 4:


where,
where,
*<code>-n</code> – Non-GUI mode – This specifies JMeter is to run in non-gui mode
*<code>-t</code> – Name of JMX file that contains Test Plan
*<code>-l</code> – Name of JTL file to capture results to
*<code>-j</code> – Name of Log file to capture execution logs


*-n – Non-GUI mode – This specifies JMeter is to run in non-gui mode
*-t – Name of JMX file that contains Test Plan
*-l – Name of JTL file to capture results to
*-j – Name of Log file to capture execution logs


After running this command, Jmeter instance will be initiated which will execute the JMX file mentioned after -t. Post execution it will create the Test result file with .jtl format. If a result file with same name already exist, it will be appended with new one.
After running this command, Jmeter instance will be initiated which will execute the JMX file mentioned after -t. Post execution it will create the Test result file with .jtl format. If a result file with same name already exist, it will be appended with new one.
Line 14: Line 14:
= Full list of command line options =
= Full list of command line options =
  jmeter -?
  jmeter -?
= hey (new name for ab) =
<code>hey</code> is compatibile with <code>curl</code> syntax.
<source lang=bash>
URL=http://example.com
hey -n 5 -c 5 -q 10 -H "Content-Type: application/json" -m POST -d '{"data": ["please keep the appt", ""]}' $URL
# | -n number of requests, default 200
# | -c number of workers; concurrent requests, default 50
# | -q rate limiting, default no limit
# | -H header, can use multiple -H
# | -m http method
# | -d data in the body
</source>


= References =
= References =
Line 19: Line 32:
*[https://learn-jmeter.blogspot.co.uk/2016/10/how-to-generate-jmeter-report-dashboard.html learn jmeter blog]
*[https://learn-jmeter.blogspot.co.uk/2016/10/how-to-generate-jmeter-report-dashboard.html learn jmeter blog]
*[http://jmeter.apache.org/usermanual/get-started.html#options Get started] Official]
*[http://jmeter.apache.org/usermanual/get-started.html#options Get started] Official]
*[https://blogs.sap.com/2016/04/06/load-testing-with-jmeter-test-results-visualization-using-kibana-dashboards/ Send JTL stats to ES and see details in Kibana]
*[https://www.pandastrike.com/posts/20160908-visualizing-distributed-jmeter-elasticsearch-fluentd-kibana/ Jmeter with ELK]

Latest revision as of 15:49, 23 June 2021

Run Jmeter in Non-GUI mode

jmeter -n -t YourJmeterTestPlan.jmx -l TestResultFile.jtl  -j LogFile.log

where,

  • -n – Non-GUI mode – This specifies JMeter is to run in non-gui mode
  • -t – Name of JMX file that contains Test Plan
  • -l – Name of JTL file to capture results to
  • -j – Name of Log file to capture execution logs


After running this command, Jmeter instance will be initiated which will execute the JMX file mentioned after -t. Post execution it will create the Test result file with .jtl format. If a result file with same name already exist, it will be appended with new one.

Full list of command line options

jmeter -?

hey (new name for ab)

hey is compatibile with curl syntax.

URL=http://example.com
hey -n 5 -c 5 -q 10 -H "Content-Type: application/json" -m POST -d '{"data": ["please keep the appt", ""]}' $URL
# | -n number of requests, default 200
# | -c number of workers; concurrent requests, default 50
# | -q rate limiting, default no limit
# | -H header, can use multiple -H
# | -m http method
# | -d data in the body

References