Reputation: 87
I've been working on trying to make a script that is seeing how the performance of the web application is when multiple APIs/Ajaxs from databases are called concurrently. This is my current approach below.
A few things I noticed when using the parallel controller was that when I use "summary report" I notice that it wasn't taking the total response time, but moreso just the highest one in the concurrent API requests.
I was wondering if there is a workaround for this and how can I create something to show both the total response time of 1 iteration and also the total response times of the APIs concurrently just by themselves?
Any help on using AJAX requests would be great help too, not sure if I am missing things that should be considered/added. (I have not added any assertions, pre/post processors, etc just yet as this is just getting the structure setup first but let me know.)
Thanks!
Upvotes: 0
Views: 234
Reputation: 168147
I fail to see a lot of sense in your requirement, given that:
I fail to see why would you need the sum of all AJAX requests response times.
Whatever, if you really need this you can extract it using i.e. JSR223 Sampler, if you put it after the Parallel Controller and use the following code:
def totalTime = 0
ctx.getPreviousResult().getSubResults().reverseEach {
totalTime += it.getTime()
}
then totalTime
object will contain Parallel Controller's children cumulative elapsed time:
See Apache Groovy: What Is Groovy Used For? article for more information on Groovy scripting in JMeter.
The value can be stored into a JMeter Variable so you can add it to the .jtl results file via Sample Variables property, plot custom over time chart, etc.
Upvotes: 0