From a9b1e11f67c7de0115677b8996ffba3845552f01 Mon Sep 17 00:00:00 2001 From: Renato Cavalcanti Date: Tue, 20 Nov 2018 16:51:50 +0100 Subject: [PATCH] removed misterious GatlingSpec I don't know how this got added. :-) --- bin/gatling/simulation/GatlingSpec.scala | 39 ------------------------ 1 file changed, 39 deletions(-) delete mode 100644 bin/gatling/simulation/GatlingSpec.scala diff --git a/bin/gatling/simulation/GatlingSpec.scala b/bin/gatling/simulation/GatlingSpec.scala deleted file mode 100644 index 5252fdeff..000000000 --- a/bin/gatling/simulation/GatlingSpec.scala +++ /dev/null @@ -1,39 +0,0 @@ -package simulation - -import io.gatling.core.Predef._ -import io.gatling.http.Predef._ -import scala.concurrent.duration._ -import scala.language.postfixOps - -// run with "sbt gatling:test" on another machine so you don't have resources contending. -// http://gatling.io/docs/2.2.2/general/simulation_structure.html#simulation-structure -class GatlingSpec extends Simulation { - - // change this to another machine, make sure you have Play running in producion mode - // i.e. sbt stage / sbt dist and running the script - val httpConf = http.baseURL("http://localhost:9000") - - val readClients = scenario("Clients").exec(Index.refreshManyTimes) - - setUp( - // For reference, this hits 25% CPU on a 5820K with 32 GB, running both server and load test. - // In general, you want to ramp up load slowly, and measure with a JVM that has been "warmed up": - // https://groups.google.com/forum/#!topic/gatling/mD15aj-fyo4 - readClients.inject(rampUsers(2000) over (100 seconds)).protocols(httpConf) - ) -} - -object Index { - - def post = { - val body = StringBody("""{ "title": "hello", "body": "world" }""") - exec(http("Index").post("/v1/posts").body(body).asJSON.check(status.is(200))).pause(1) - } - - def refreshAfterOneSecond = - exec(http("Index").get("/").check(status.is(200))).pause(1) - - val refreshManyTimes = repeat(500) { - refreshAfterOneSecond - } -}