|
1 |
| -package api.http.load |
| 1 | +package api.http.benchmark |
2 | 2 |
|
| 3 | +import com.typesafe.config.ConfigFactory |
3 | 4 | import io.gatling.core.Predef._
|
4 | 5 | import io.gatling.http.Predef._
|
| 6 | + |
5 | 7 | import scala.concurrent.duration._
|
6 | 8 | import scala.language.postfixOps
|
7 | 9 |
|
8 | 10 | class FilingSimulation extends Simulation {
|
9 | 11 |
|
| 12 | + val config = ConfigFactory.load() |
| 13 | + val host = config.getString("hmda.benchmark.host") |
| 14 | + val port = config.getInt("hmda.benchmark.port") |
| 15 | + val nrOfUsers = config.getInt("hmda.benchmark.nrOfUsers") |
| 16 | + |
| 17 | + val institutionIds = (1 to nrOfUsers).toList |
| 18 | + |
10 | 19 | val httpProtocol = http
|
11 |
| - .baseURL("http://localhost:8080") |
| 20 | + .baseURL(s"http://$host:$port") |
12 | 21 | .acceptHeader("text/html,application/xhtml+xml,application/json;q=0.9,*/*;q=0.8")
|
13 | 22 | .acceptEncodingHeader("gzip, deflate")
|
14 | 23 | .acceptLanguageHeader("en-US,en;q=0.5")
|
15 | 24 | .acceptLanguageHeader("en-US,en;q=0.5")
|
16 | 25 | .userAgentHeader("Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0")
|
17 | 26 | .header("cfpb-hmda-username", "user")
|
18 |
| - .header("cfpb-hmda-institutions", "0,1,2,3,4,5,243179,35057,6999998,6999999,4277") |
| 27 | + .header("cfpb-hmda-institutions", institutionIds.mkString(",")) |
19 | 28 |
|
20 | 29 | val filingScenario = scenario("HMDA Filing")
|
21 | 30 | .exec(http("GET Institutions")
|
|
0 commit comments