From 038901a40d73df1232cb02ff185fd42bcb155f3c Mon Sep 17 00:00:00 2001 From: Renato Cavalcanti Date: Fri, 16 Nov 2018 15:25:15 +0100 Subject: [PATCH 1/4] Updated with template-control on 2018-11-16T14:25:15.563Z **build.sbt: scalaVersion := "2.12.6" **/plugins.sbt: addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.20") **build.gradle: def playVersion = "2.6.20" --- build.gradle | 2 +- build.sbt | 2 +- project/plugins.sbt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 1b3ce62de..ac630598f 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { id "com.github.lkishalmi.gatling" version "0.7.1" } -def playVersion = "2.6.19" +def playVersion = "2.6.20" def scalaVersion = System.getProperty("scala.binary.version", /* default = */ "2.12") def gatlingVersion = getGlatlingVersion(scalaVersion) diff --git a/build.sbt b/build.sbt index dd1fdc477..fb6d2e4f8 100644 --- a/build.sbt +++ b/build.sbt @@ -9,7 +9,7 @@ def gatlingVersion(scalaBinVer: String): String = scalaBinVer match { inThisBuild( List( - scalaVersion := "2.12.6", +scalaVersion := "2.12.6" crossScalaVersions := Seq("2.11.12", "2.12.6"), dependencyOverrides := Seq( "org.codehaus.plexus" % "plexus-utils" % "3.0.18", diff --git a/project/plugins.sbt b/project/plugins.sbt index e90ed6090..184947994 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,5 @@ // The Play plugin -addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.19") +addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.20") // Load testing tool: // http://gatling.io/docs/2.2.2/extensions/sbt_plugin.html From 7197d65db275272f65037f88e38c9aaf25bfb45a Mon Sep 17 00:00:00 2001 From: Renato Cavalcanti Date: Tue, 20 Nov 2018 16:48:51 +0100 Subject: [PATCH 2/4] fixed build.sbt --- bin/gatling/simulation/GatlingSpec.scala | 39 ++++++++++++++++++++++++ build.sbt | 4 +-- 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 bin/gatling/simulation/GatlingSpec.scala diff --git a/bin/gatling/simulation/GatlingSpec.scala b/bin/gatling/simulation/GatlingSpec.scala new file mode 100644 index 000000000..5252fdeff --- /dev/null +++ b/bin/gatling/simulation/GatlingSpec.scala @@ -0,0 +1,39 @@ +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 + } +} diff --git a/build.sbt b/build.sbt index fb6d2e4f8..f8f99a0b5 100644 --- a/build.sbt +++ b/build.sbt @@ -9,8 +9,8 @@ def gatlingVersion(scalaBinVer: String): String = scalaBinVer match { inThisBuild( List( -scalaVersion := "2.12.6" - crossScalaVersions := Seq("2.11.12", "2.12.6"), + scalaVersion := "2.12.7", + crossScalaVersions := Seq("2.11.12", "2.12.7"), dependencyOverrides := Seq( "org.codehaus.plexus" % "plexus-utils" % "3.0.18", "com.google.code.findbugs" % "jsr305" % "3.0.1", From a9b1e11f67c7de0115677b8996ffba3845552f01 Mon Sep 17 00:00:00 2001 From: Renato Cavalcanti Date: Tue, 20 Nov 2018 16:51:50 +0100 Subject: [PATCH 3/4] 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 - } -} From 0a371a66f41e8af7edcf581bf409ba47e08c6127 Mon Sep 17 00:00:00 2001 From: Renato Cavalcanti Date: Tue, 20 Nov 2018 17:10:01 +0100 Subject: [PATCH 4/4] removed jdk 9 and 10 --- .travis.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index aa5e49edc..83d95a53b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,9 +6,7 @@ scala: - 2.12.6 jdk: - oraclejdk8 -- oraclejdk9 -- oraclejdk10 -- oraclejdk11 +- openjdk11 env: matrix: - SCRIPT=scripts/test-sbt @@ -29,11 +27,7 @@ before_cache: matrix: exclude: - scala: 2.11.12 - jdk: oraclejdk9 - - scala: 2.11.12 - jdk: oraclejdk10 - - scala: 2.11.12 - jdk: oraclejdk11 + jdk: openjdk11 allow_failures: # We should allow failures here since Java 11 removed some modules including # java.xml.bind which we are adding when running with Java 9+. For more details @@ -41,7 +35,7 @@ matrix: # # Play already has a fix for that, but it needs to be backported and released # for 2.6.x: https://github.com/playframework/playframework/pull/8382 - - jdk: oraclejdk11 + - jdk: openjdk11 # See https://blog.travis-ci.com/2014-03-13-slack-notifications/ # created with travis encrypt command line tool