Skip to content

Commit 4d35670

Browse files
committed
Configure host, port and number of users
1 parent 45d027d commit 4d35670

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
hmda {
2+
benchmark {
3+
host = "localhost"
4+
host = ${?HMDA_BENCHMARK_HOST}
5+
port = "8080"
6+
port = ${?HMDA_BENCHMARK_PORT}
7+
nrOfUsers = 500
8+
}
9+
}

cluster/src/test/scala/api/http/load/FilingSimulation.scala renamed to cluster/src/test/scala/api/http/benchmark/FilingSimulation.scala

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
1-
package api.http.load
1+
package api.http.benchmark
22

3+
import com.typesafe.config.ConfigFactory
34
import io.gatling.core.Predef._
45
import io.gatling.http.Predef._
6+
57
import scala.concurrent.duration._
68
import scala.language.postfixOps
79

810
class FilingSimulation extends Simulation {
911

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+
1019
val httpProtocol = http
11-
.baseURL("http://localhost:8080")
20+
.baseURL(s"http://$host:$port")
1221
.acceptHeader("text/html,application/xhtml+xml,application/json;q=0.9,*/*;q=0.8")
1322
.acceptEncodingHeader("gzip, deflate")
1423
.acceptLanguageHeader("en-US,en;q=0.5")
1524
.acceptLanguageHeader("en-US,en;q=0.5")
1625
.userAgentHeader("Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0")
1726
.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(","))
1928

2029
val filingScenario = scenario("HMDA Filing")
2130
.exec(http("GET Institutions")

0 commit comments

Comments
 (0)