1
votes

I have a test suite running well in the GUI and will want to run it from the command line. No problem there, I understand how to do that.

In the suite I have a Summary Report object that shows me the min, max and avg response times in a table. There is a 'configure' button on the summary report that allows me to choose fields I can write to a file for capturing the results. However, all I want is the min, max, and average and these do not seem to be fields that I can record.

Can anyone suggest a way I can access these values, perhaps from a Beanshell or something?

My suite will have a number of thread groups and I want to create a unique summary report file for each so that I can drive some plots in Jenkins.

Thanks in advance for any help.

Brad

1
What you are trying to do is not possible afaik. The summary report basically calculates those min, max and average values and shows them in the jmeter gui, and it needs a .csv file with all the logs inside it. What you could do is put some simple data writers on each thread group. Let those write to a log during the run in non-gui mode. Afterwards you can open those logs with the summary report and you can use this for different reports per thread groupDemoric
Thanks, Johan, Seems a pity to discard the calculated results and redo the work but that's ok as it is not too onerous to write a wrapper script to call JMeter on the command line and then parse the logs. Thanks for the response. Bradsteadyonabix

1 Answers

1
votes

Simple Beanshell script should be the best solution. I would suggest to use Beanshell Post Processors to record time for each request into a file named accordingly to thread group name.

To each Sampler in your Thread Group add Beanshell Post Processor with the following code:

long time = prev.getTime(); //get Sampler Execution Time
String samplerName = prev.getSampleLabel(); //get Sampler Name
String threadGroupName = ctx.getThreadGroup().getName(); // get Thread Group Name
FileOutputStream out = new FileOutputStream(threadGroupName + ".csv", true); // Create output file called ${Thread Group}.csv

//append information to the file
StringBuilder sb = new StringBuilder();
sb.append(samplerName);
sb.append(",");
sb.append(time);
sb.append(System.getProperty("line.separator"));

out.write(sb.toString().getBytes("UTF-8"));
out.flush();
out.close();

Similarly you can get and store whatever you need. Min, Max and Avg times should be calculated after the test. I guess that Jenkins is smart enough to plot this however sampler timestamp could also be required.

References: