repeat and during doesn't loop

Hi guys,

I’m going crazy and would like some help. I’m doing a really really simple script.


import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._

class MySimulation extends Simulation {

  val threads   = Integer.getInteger("threads",  10)
  val rampup    = Integer.getInteger("rampup",   10).toLong
  val duration  = Integer.getInteger("duration", 120).toLong
  

  val httpProtocol = http
    .baseURL("[https://stuff.something.ta](https://srvpub.lotoquebec.ta/)")
    .acceptEncodingHeader("gzip, deflate")

  val scn = scenario("scenario")
    .repeat(20) {
      exec(http("home")
        .get("/fr/home"))
    }

  setUp(scn.inject(rampUsers(threads) over (rampup seconds))).protocols(httpProtocol)
}

It doesn't loop. Same thing with during. At the end, only 10 queries have been executing.... I have no idea why.

Can you help?

Man, you’re not as sharp since you moved back! Too much cold grips your brains :wink:
What kind of mechanism would cause a browser to not fetch again a page it already has a local copy of?

Oh dear God… Caching is enabled by default?!? (Answer: Yes. disableCaching worked perfectly… You really need a cache resource counter or some cache report or something)

Is there a way to clear caching at the end of each loop?

But there is still something that is not normal. It never stops. It keeps doing nothing forever.

Oh dear God... Caching is enabled by default?!?

Yes, as documented, default behavior is to mimic a browser (as much as
possible), so cookies, caching and following redirects are enabled by
default, on contrary to some other load test tools.

(Answer: Yes. disableCaching worked perfectly... You really need a cache
resource counter or some cache report or something)

You would see it in the logs if you lower logging level.
But mostly, you need to get rid of old habits from other tools :wink:

Is there a way to clear caching at the end of each loop?

You're describing a closed workload model, and I'm willing to bet that you
actually need an open one:
http://gatling.io/docs/2.2.0/general/simulation_setup.html?highlight=closed%20models#injection
Another very bad habit from other tools usage.

But yes, you can clear cache if REALLY needed:
http://gatling.io/docs/2.2.0/http/http_helpers.html?highlight=closed#flushing-the-cache

It's all in the doc. Take 30 mins to read everything.

But there is still something that is not normal. It never stops. It keeps
doing nothing forever.

Could you please share a reproducer?

You do know I never use any other unless forced to :stuck_out_tongue:

You are currently in competition with an old Gatling version :stuck_out_tongue:

I tried to lower the logs. But I should probably have lowered root instead of only io.gatling.http (I also had a weird encoding exception when retrieving a png file. I haven’t had the time to investigate).

But yes, I need to read the documentation. Is there a PDF? (I’m serious. I’ll read it in the bus). And yes, I was going for throttling but might get more accurate results with something else indeed.

The reproducer is this exact script I gave in my first mail (using Gatling 2.2.0). The get URL should be cached. The response headers received are:

  1. Cache-Control:
    max-age=220, public

  2. Connection:
    Keep-Alive

  3. Content-Encoding:
    gzip

  4. Content-Type:
    text/html;charset=UTF-8

  5. Date:
    Tue, 17 May 2016 21:57:06 GMT

  6. Expires:
    Tue, 17 May 2016 22:00:46 GMT

  7. Keep-Alive:
    timeout=15, max=100

  8. Last-Modified:
    Tue, 17 May 2016 21:57:06 GMT

  9. Pragma:

  10. Transfer-Encoding:
    chunked

  11. Vary:
    Accept-Encoding

  12. X-Frame-Options:
    SAMEORIGIN

  13. X-Powered-By:
    Some company

  14. X-UA-Compatible:
    IE=11,IE=10,IE=9,IE=8

Same issue with 2.2.1-SNAPSHOT.