Hi, I was developing a scenario to an app that is based on maps (like google maps). So the scenario to my User is:
Request 8 parts of the map in the server (8 gets) to fill the screen. This should be done in the same time.
I wrote like this:
val pngWithTile = feed(feeder).exec(http(“png_with_tile”).get("/map/teste_marcelodb_porto/${tile}/tile.png?styleid=style_test&stylenames[]=stylePt&mapkey=123")).pause(2)
@Neil : This form of exec doesn’t work that way, execs will still get chained.
This form of exec is only a convenience, but has it uses (used it myself today) : Imagine that you have a bunch of request that follows almost the same pattern. You could write a Scala function that generate a list of requests, chained all together and then use this form of exec to plug them in your scenario :
The problem here is your pause duration: if you use your pngWithTile chain inside one of Gatling’s looping structures, each request will be fired only two seconds after the last one.
If you drop the .pause(2) from your chain, your requests won’t still be fired at the exact same time, but unless the system under tests takes a lot of time to respond to those requests, the delay beetween each request would be pretty small.
Hi Pierre, Everton, I think you need to go back and look more closely at the page you are trying to model.
write it down.
initial URL request returns html which
causes the browser to execute some js which
calls 8 further URLs in parallel as the requests do not block [each other] (possibly as the js injects some resource links into the DOM, which the browser downloads in parallel)
if so:
you will have to use gatling 2
val map_image = http(“png_with_tile”).get("/map/teste_marcelodb_porto/${tile}/tile.png?styleid=style_test&stylenames[]=stylePt&mapkey=123")
val pngWithTile = feed(feeder).exec(
http(“png_with_tile”)
.get("/page_url")
.resources(map_image,map_image,map_image,map_image,
map_image,map_image,map_image,map_image)
// pause here if there is another page that the user views, else no need for a pause as not looping.
Don’t loop unless your users are obsessive compulsive map viewers, or admin staff → instead use usersPerSecond() if they are normal users that only view a few pages then leave the site.