Skip to content

Instantly share code, notes, and snippets.

@nremond
Last active December 10, 2015 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nremond/4486383 to your computer and use it in GitHub Desktop.
Save nremond/4486383 to your computer and use it in GitHub Desktop.
Gatling simulation that hightlights the problem with Gatling when using SSL session tracking.
package basic
import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
import bootstrap._
class BasicExampleSimulation extends Simulation {
val counterFeeder = new Feeder[Int] {
private val gen = Stream.from(1).toIterator
override def hasNext = true
override def next: Map[String, Int] = Map("counter" -> gen.next)
}
val httpConf = httpConfig.baseURL("https://localhost:8443/ssl-session-tracking")
val scn = scenario("SSL issue scenario")
.feed(counterFeeder)
.exec(http("Root1")
.get("/index.jsp").queryParam("s", "${counter}")
.check(
regex("""s in session = ${counter}""").exists
))
.exec(http("Root2")
.get("/index.jsp")
.check(
regex("""s in session = (\d+)""").find.is("${counter}")
))
setUp(scn.users(100).ramp(10).protocolConfig(httpConf))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment