Skip to content
Browse files

Add the request url and response code to the simulation log.

  • Loading branch information...
1 parent 7a7f2d9 commit 21bf88b33315df24b56f675bf54574547dacdad7 @skuenzli committed Jun 14, 2012
View
8 sample-webapp/pom.xml
@@ -14,8 +14,7 @@
<roo.version>1.2.1.RELEASE</roo.version>
<slf4j.version>1.6.4</slf4j.version>
<spring.version>3.1.0.RELEASE</spring.version>
- <!--<gatling.version>1.1.6</gatling.version>-->
- <gatling.version>1.2.0-SNAPSHOT</gatling.version>
+ <gatling.version>1.2.3-SNAPSHOT</gatling.version>
</properties>
<repositories>
<repository>
@@ -315,6 +314,11 @@
<artifactId>tiles-jsp</artifactId>
<version>2.2.2</version>
</dependency>
+ <dependency>
+ <groupId>com.excilys.ebi.gatling</groupId>
+ <artifactId>gatling-http</artifactId>
+ <version>${gatling.version}</version>
+ </dependency>
</dependencies>
<build>
<plugins>
View
12 ...le-webapp/src/main/resources/simulations/OutstandingRequestLimitingFilterSimulation.scala
@@ -1,5 +1,6 @@
import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
+import com.ning.http.client.{Response, Request}
class OutstandingRequestLimitingFilterSimulation extends Simulation {
@@ -8,14 +9,18 @@ class OutstandingRequestLimitingFilterSimulation extends Simulation {
val urlBase = "http://localhost:8080"
val httpConf = httpConfig.baseURL(urlBase)
+ .requestInfoExtractor((request: Request) => {
+ List[String](request.getRawUrl)
+ })
+ .responseInfoExtractor((response: Response) => {
+ List[String](response.getStatusCode.toString())
+ })
val headers_standard = Map(
"Accept" -> "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Charset" -> "ISO-8859-1,utf-8;q=0.7,*;q=0.7",
"Accept-Encoding" -> "gzip,deflate",
- "Accept-Language" -> "fr,en-us;q=0.7,en;q=0.3",
"Host" -> "localhost:8080",
- "Keep-Alive" -> "115",
"User-Agent" -> "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110422 Ubuntu/9.10 (karmic) Firefox/3.6.17")
val scn = scenario("Request overload")
@@ -27,9 +32,8 @@ class OutstandingRequestLimitingFilterSimulation extends Simulation {
.headers(headers_standard)
.check(status.in(List(200, 503))))
/* .pause(0, 50, MILLISECONDS) */
- //pauseExp is supported in https://github.com/skuenzli/gatling 1.1.6-SNAPSHOT and later
.pauseExp(100, MILLISECONDS)
- ).during(3, MINUTES)
+ ).during(1, MINUTES)
List(scn.configure.users(100).ramp(10).protocolConfig(httpConf))
}

0 comments on commit 21bf88b

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