How to map reduce on chain ?

I’m looking to write something like this in a scenario :

val imagesChain = group(“images”) {

(1 to 89).map(i=> exec(http(s"image#$i").get(s"images/$i.png").check( ).reduce( _ anop _)


is it possible ? which reduce operator can I use ?



Isn’t it obvious? :wink:




ok now it is :slight_smile: I will try tomorrow, thanks.

Something else I was wondering, is there a way to simulate the number of parallel http connections a navigator establishes ?

Firefox 2:  2
Firefox 3+: 6
Opera 9.26: 4
Opera 12:   6
Safari 3:   4
Safari 5:   6
IE 7:       2
IE 8:       6
IE 10:      8
Chrome:     6

So if a home page requires to load 6 files, the response time for the page (or the group made of the home page and its “internal” files, images, …) will be the response time of the main content, and the highest response time between “internal” files and not the sum of them.

Something like this :
group(“homepage”) {
.parallel(6) {

It’s just a remark, a question I asked myself; in order to simulate more real virtual users.


That’s something I’ve been considering, but it’s not possible at the moment.

The problem is: even if we were to implement this, where would you take your static resources list from?

Some other tools pretend handling automagically static resources, but they actually only get the immediate ones: img, style and script tags. This approach worked 10 years ago but doesn’t work with modern web development: images are loaded from css or from javascript, javascript loads other javascript, etc, and you’re supposed to cache them or even use a CDN anyway…

You’d need a real browser, but webkits will always be too CPU/memory consuming to handle load stress (or you’d need huge farms).


Creating a chain using map reduce, the working example :

val images = group(“images”) {
(1 to 89).map{ i=>
}.reduce(_ exec _)

it was really obvious :slight_smile: