Plugin for total time or Latest Sample command line

12 views
Skip to first unread message

Shashikanth Channagiri

unread,
Sep 16, 2021, 6:19:23 PM9/16/21
to jmeter-plugins
I am running Tests from command line, please let me know from which Plugin Type, 
can I find total time or Latest Sample(Similar to the one in Graph Results)

DT

unread,
Sep 17, 2021, 8:31:34 AM9/17/21
to jmeter-plugins
I'm not aware of any existing plugin, if you have only one Thread Group and would like to see the response time of the latest sample in console you can add a JSR223 Sampler as the last sampler in the Thread Group and use the following code there:

SampleResult.setIgnore()
OUT.println('Latest sampler elapsed time: ' + ctx.getPreviousResult().getTime())

  1. The first line instructs JMeter to not to consider the execution of the JSR223 Sampler itself (neither report it to Listeners nor store in the .jtl results file)
  2. The second line prints the last sampler (the one above the JSR223 Sampler) execution time to the STDOUT  

See Top 8 JMeter Java Classes You Should Be Using with Groovy article for more information on these SampleResult, OUT and other JMeter API shorthands available for the JSR223 Test Elements. 
Reply all
Reply to author
Forward
0 new messages