I have a gatling scenario where I retrieve 1000 documents from a database via a RESTful API.
I then modify the documents and send update requests for each.
This is how I'm currently doing it:
...
val scrollQueries = scenario("Enrichment Topologies").exec(ScrollQueryInitiator.query, repeat(numberOfPagesToScrollThrough, "scrollQueryCounter"){
exec(ScrollQuery.query, pause(10 seconds).foreach("${hitsJson}", "hit"){ exec(HitProcessor.query) })
})
...
Here are the main features of interest:
ScrollQuery.query
fetches the 1000 results and saves them intohitsJson
in the session.- It then pauses for 10 seconds to simulate longer-term processing.
- The 1000 results are iterated over and for each item a
HitProcessor
is run which sends the update request
In reality, the foreach loop ensures that each request is sent one after the other.
Question
What I really want is to work through the 1000 results in groups of 10, sending update requests in parallel 10 at a time.
How can I achieve this?