Missing content length extractor
When you launch a test on Flood we extract results using InfoExtractors to write Content-Length and StatusCode headers to the simulation log file.
Please ensure that your test plan extracts the Content-Length header as follows.
1
response.getHeader("Content-Length")
2
Copied!
Example shown below:
1
import scala.concurrent.duration._
2
3
import io.gatling.core.Predef._
4
import io.gatling.http.Predef._
5
import io.gatling.jdbc.Predef._
6
7
8
class TestPlan extends Simulation {
9
10
val uuid = List(System.getProperty("uuid"))
11
12
val httpProtocol = http
13
.baseURL("http://google.com")
14
.acceptHeader("text/html,application/xhtml+xml,application/xml;")
15
.acceptEncodingHeader("gzip, deflate")
16
.extraInfoExtractor((status, session, request, response) =>
17
List(uuid, Option(response.getHeader("Content-Length")).getOrElse("0"), response.getStatusCode.toString))
18
19
val scn = scenario("Scenario Name")
20
.exec(http("first_page")
21
.get("/"))
22
.pause(1000 milliseconds, 5000 milliseconds)
23
24
setUp(scn.inject(ramp(10 users) over (60 seconds))).protocols(httpProtocol)
25
}
Copied!
Copy link