Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bumped to support Gatling 1.4.3

  • Loading branch information...
commit 206288ceed1e5918e89ccd22a3cfeca1d27176e9 1 parent 1eea3aa
krishnen authored
View
10 project/Build.scala
@@ -12,7 +12,7 @@ object BuildSettings {
val buildOrganization = "org.krishnen.gatling.sbt"
val buildVersion = "0.0.2"
- val buildScalaVersion = "2.9.2"
+ val buildScalaVersion = "2.9.3-RC1"
val globalSettings = Seq(
organization := buildOrganization,
@@ -53,10 +53,10 @@ object Dependencies {
"Excilys" at "http://repository.excilys.com/content/groups/public")
object V {
- val slf4j = "1.6.4"
+ val slf4j = "1.7.2"
val logback = "1.0.0"
- val gatling = "1.3.4"
- val redis = "2.7"
+ val gatling = "1.4.3"
+ val redis = "2.9"
}
object Compile {
@@ -65,6 +65,6 @@ object Dependencies {
val gatlingHighCharts = "com.excilys.ebi.gatling.highcharts" % "gatling-charts-highcharts" % V.gatling % "compile"
val logback = "ch.qos.logback" % "logback-classic" % "1.0.0" % "runtime"
val log4j = "log4j" % "log4j" % "1.2.14" % "compile"
- val redis = "net.debasishg" %% "redisclient" % V.redis % "compile"
+ val redis = "net.debasishg" % "redisclient_2.9.2" % V.redis % "compile"
}
}
View
17 src/main/scala/advanced/AdvancedExampleSimulation.scala
@@ -1,13 +1,16 @@
package advanced
+
import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
+import com.excilys.ebi.gatling.jdbc.Predef._
+import com.excilys.ebi.gatling.http.Headers.Names._
+import scala.concurrent.duration._
class AdvancedExampleSimulation extends Simulation {
- def apply = {
- val urlBase = "http://excilys-bank-web.cloudfoundry.com"
- val httpConf = httpConfig.baseURL(urlBase)
- List(SomeScenario.scn.configure.users(10).ramp(10).protocolConfig(httpConf),
- SomeOtherScenario.otherScn.configure.users(5).ramp(20).delay(30).protocolConfig(httpConf))
- }
-}
+ val httpConf = httpConfig.baseURL("http://excilys-bank-web.cloudfoundry.com").disableFollowRedirect
+
+ setUp(
+ SomeScenario.scn.users(10).ramp(10).protocolConfig(httpConf),
+ SomeOtherScenario.otherScn.users(5).ramp(20).delay(30).protocolConfig(httpConf))
+}
View
2  src/main/scala/advanced/SomeOtherScenario.scala
@@ -33,4 +33,4 @@ object SomeOtherScenario {
.exec(
http("other_request_10")
.get("/public/login.html"))
-}
+}
View
4 src/main/scala/advanced/SomeScenario.scala
@@ -56,7 +56,7 @@ object SomeScenario {
.headers(headers_8))
.pause(6, 7)
}
- .doIf((session: Session) => session.getAttribute("username") != "user7") {
+ .doIf(session => session.getAttribute("username") != "user7") {
exec(
http("request_9")
.get("/logout")
@@ -67,4 +67,4 @@ object SomeScenario {
.get("/public/login.html")
.headers(headers_1))
}
-}
+}
View
152 src/main/scala/basic/BasicExampleSimulation.scala
@@ -9,87 +9,83 @@ import bootstrap._
class BasicExampleSimulation extends Simulation {
- def apply = {
+ val httpConf = httpConfig
+ .baseURL("http://excilys-bank-web.cloudfoundry.com")
+ .acceptCharsetHeader("ISO-8859-1,utf-8;q=0.7,*;q=0.7")
+ .acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
+ .acceptEncodingHeader("gzip, deflate")
+ .acceptLanguageHeader("fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3")
+ .disableFollowRedirect
- val httpConf = httpConfig
- .baseURL("http://excilys-bank-web.cloudfoundry.com")
- .acceptCharsetHeader("ISO-8859-1,utf-8;q=0.7,*;q=0.7")
- .acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
- .acceptEncodingHeader("gzip, deflate")
- .acceptLanguageHeader("fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3")
- .hostHeader("excilys-bank-web.cloudfoundry.com")
- .disableFollowRedirect
+ val headers_1 = Map(
+ "Keep-Alive" -> "115")
- val headers_1 = Map(
- "Keep-Alive" -> "115")
+ val headers_3 = Map(
+ "Keep-Alive" -> "115",
+ "Content-Type" -> "application/x-www-form-urlencoded")
- val headers_3 = Map(
- "Keep-Alive" -> "115",
- "Content-Type" -> "application/x-www-form-urlencoded")
+ val headers_6 = Map(
+ "Accept" -> "application/json, text/javascript, */*; q=0.01",
+ "Keep-Alive" -> "115",
+ "X-Requested-With" -> "XMLHttpRequest")
- val headers_6 = Map(
- "Accept" -> "application/json, text/javascript, */*; q=0.01",
- "Keep-Alive" -> "115",
- "X-Requested-With" -> "XMLHttpRequest")
-
- val scn = scenario("Scenario name")
- .exec(
- http("request_1")
- .get("/")
- .headers(headers_1)
- .check(status.is(302)))
- .pause(0 milliseconds, 100 milliseconds)
- .exec(
- http("request_2")
- .get("/public/login.html")
- .headers(headers_1))
- .pause(12, 13)
- .feed(csv("user_information.csv"))
- .exec(
- http("request_3")
- .post("/login")
- .param("username", "${username}")
- .param("password", "${password}")
- .headers(headers_3)
- .check(status.is(302)))
- .pause(0 milliseconds, 100 milliseconds)
- .repeat(5) {
- exec(
- http("request_4")
- .get("/private/bank/accounts.html")
- .headers(headers_1))
- .pause(7, 8)
- .exec(
- http("request_5")
- .get("/private/bank/account/ACC${account_id}/operations.html")
- .headers(headers_1))
- .pause(100 milliseconds, 200 milliseconds)
- .exec(
- http("request_6")
- .get("/private/bank/account/ACC${account_id}/year/2011/month/12/page/0/operations.json")
- .headers(headers_6))
- .pause(4, 5)
- .exec(
- http("request_7")
- .get("/private/bank/account/ACC${account_id}/year/2011/month/11/operations.html")
- .headers(headers_1))
- .pause(100 milliseconds, 200 milliseconds)
- .exec(
- http("request_8")
- .get("/private/bank/account/ACC${account_id}/year/2011/month/11/page/0/operations.json")
- .headers(headers_6))
- .pause(6, 7)
- }.exec(
- http("request_9")
- .get("/logout")
- .headers(headers_1)
- .check(status.is(302)))
- .pause(0 milliseconds, 100 milliseconds)
- .exec(
- http("request_10")
- .get("/public/login.html")
+ val scn = scenario("Scenario name")
+ .exec(
+ http("request_1")
+ .get("/")
+ .headers(headers_1)
+ .check(status.is(302)))
+ .pause(0 milliseconds, 100 milliseconds)
+ .exec(
+ http("request_2")
+ .get("/public/login.html")
+ .headers(headers_1))
+ .pause(12, 13)
+ .feed(csv("user_information.csv"))
+ .exec(
+ http("request_3")
+ .post("/login")
+ .param("username", "${username}")
+ .param("password", "${password}")
+ .headers(headers_3)
+ .check(status.is(302)))
+ .pause(0 milliseconds, 100 milliseconds)
+ .repeat(5) {
+ exec(
+ http("request_4")
+ .get("/private/bank/accounts.html")
.headers(headers_1))
+ .pause(7, 8)
+ .exec(
+ http("request_5")
+ .get("/private/bank/account/ACC${account_id}/operations.html")
+ .headers(headers_1))
+ .pause(100 milliseconds, 200 milliseconds)
+ .exec(
+ http("request_6")
+ .get("/private/bank/account/ACC${account_id}/year/2011/month/12/page/0/operations.json")
+ .headers(headers_6))
+ .pause(4, 5)
+ .exec(
+ http("request_7")
+ .get("/private/bank/account/ACC${account_id}/year/2011/month/11/operations.html")
+ .headers(headers_1))
+ .pause(100 milliseconds, 200 milliseconds)
+ .exec(
+ http("request_8")
+ .get("/private/bank/account/ACC${account_id}/year/2011/month/11/page/0/operations.json")
+ .headers(headers_6))
+ .pause(6, 7)
+ }.exec(
+ http("request_9")
+ .get("/logout")
+ .headers(headers_1)
+ .check(status.is(302)))
+ .pause(0 milliseconds, 100 milliseconds)
+ .exec(
+ http("request_10")
+ .get("/public/login.html")
+ .headers(headers_1))
- List(scn.configure.users(10).ramp(10).protocolConfig(httpConf))
- }
-}
+ setUp(scn.users(10).ramp(10).protocolConfig(httpConf))
+}
View
13 src/main/scala/other/ByteArrayBodySimulation.scala
@@ -14,14 +14,13 @@ import serialization._
class ByteArrayBodySimulation extends Simulation {
val redisPool = new RedisClientPool("localhost", 6379)
- def apply = {
- val urlBase = "http://localhost:8080"
- val httpConf = httpConfig.baseURL(urlBase)
+ val urlBase = "http://localhost:8080"
+ val httpConf = httpConfig.baseURL(urlBase)
- val header = Map(
+ val header = Map(
"Content-Type" -> "application/octet-stream")
- val scn = scenario("Scenario name")
+ val scn = scenario("Scenario name")
.repeat(10) {
exec((session: Session) => {
http("Protocol Buffer - hola").post("/hola")
@@ -31,8 +30,8 @@ class ByteArrayBodySimulation extends Simulation {
})
.pause(7, 8)
}
- List(scn.configure.users(10).ramp(1).protocolConfig(httpConf))
- }
+
+ setUp(scn.users(1).ramp(10).protocolConfig(httpConf))
val getByteArrayBody = (session: Session) => {
import Parse.Implicits.parseByteArray
View
20 src/main/scala/other/RedisSimulation.scala
@@ -3,20 +3,19 @@ package other
import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
import com.excilys.ebi.gatling.jdbc.Predef._
-import com.excilys.ebi.gatling.http.Headers.Names._
import com.excilys.ebi.gatling.redis.Predef.redisFeeder
-import akka.util.duration._
+import com.excilys.ebi.gatling.http.Headers.Names._
+import scala.concurrent.duration._
import bootstrap._
+import assertions._
import com.redis._
-import serialization._
class RedisSimulation extends Simulation {
- val redisPool = new RedisClientPool("localhost", 6379)
-
- def apply = {
- val urlBase = "http://192.168.1.132:88"
- val httpConf = httpConfig.baseURL(urlBase)
- val scn = scenario("Scenario name")
+ val redisPool = new RedisClientPool("localhost", 6379)
+ val urlBase = "http://localhost:8080"
+ val httpConf = httpConfig.baseURL(urlBase)
+
+ val scn = scenario("Scenario name")
.feed(redisFeeder(redisPool, "URLS"))
.repeat(10) {
exec((session: Session) => {
@@ -26,6 +25,5 @@ class RedisSimulation extends Simulation {
})
.pause(7, 8)
}
- List(scn.configure.users(10).ramp(10).protocolConfig(httpConf))
- }
+ setUp(scn.users(1).ramp(10).protocolConfig(httpConf))
}

0 comments on commit 206288c

Please sign in to comment.
Something went wrong with that request. Please try again.