Hello!
I’m new in gatling, scala, english…
my problem is
I want loop csv file and reach each exec in roundRobinSwitch
csv file size == 10000
query
1
2
…
10000
result end query=200
i can’t find solution…
i want total number of requests = csv line count (10000)
and query=1… to 10000
Here is my code
val sb1 = http(“sb1”).get(“http://localhost:8000/1.txt”)
val sb2 = http(“sb1”).get(“http://localhost:8000/2.txt”)
val sb3 = http(“sb1”).get(“http://localhost:8000/3.txt”)
val query_sets = csv(“sample_1M_query”)
val queue_size = query_sets.records.size
val count = new java.util.concurrent.atomic.AtomicInteger(0)
val scn = scenario(“Breeze Performance Test”)
.asLongAs(_ => count.getAndIncrement() < queue_size) {
feed(query_sets)
.roundRobinSwitch(
exec(sb1
.queryParam(“q”, “${query}”)
.queryParam(“sb1”, count)
.check(status.is(200))),
exec(sb2
.queryParam(“q”, “${query}”)
.queryParam(“sb2”, count)
.check(status.is(200))),
exec(sb3
.queryParam(“q”, “${query}”)
.queryParam(“sb3”, count)
.check(status.is(200)))
)
}
setUp(scn.inject(atOnceUsers(5))
.throttle(reachRps(40) in (0 seconds), holdFor(100 seconds)))
127.0.0.1 - - [13/May/2014 10:59:03] “GET /3.txt?sb3=980&q=198 HTTP/1.1” 200 -
127.0.0.1 - - [13/May/2014 10:59:03] “GET /1.txt?q=199&sb1=985 HTTP/1.1” 200 -
127.0.0.1 - - [13/May/2014 10:59:03] “GET /2.txt?q=200&sb2=990 HTTP/1.1” 200 -
127.0.0.1 - - [13/May/2014 10:59:03] “GET /3.txt?sb3=995&q=201 HTTP/1.1” 200 -
127.0.0.1 - - [13/May/2014 10:59:03] “GET /1.txt?q=202&sb1=1000 HTTP/1.1” 200 -