scala - Passing parameter - number of users -
i'm using gatling in linux terminal. when pass parameter described in github error:
value users not member of integer
this code:
package mypackage import io.gatling.core.predef._ import io.gatling.http.predef._ import io.gatling.jdbc.predef._ import io.gatling.http.headers.names._ import scala.concurrent.duration._ import bootstrap._ import assertions._ import util.random class mysimulation extends simulation { val userscount = integer.getinteger("users", 1) val links = csv("links.csv").random val httpprotocol = http .baseurl("http://mywebsite.com:8080/") .acceptcharsetheader("iso-8859-1,utf-8;q=0.7,*;q=0.7") .acceptheader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") .acceptencodingheader("gzip, deflate") .acceptlanguageheader("fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3") .disablefollowredirect val headers_1 = map( "keep-alive" -> "115") val headers_3 = map( "keep-alive" -> "115", "content-type" -> "application/x-www-form-urlencoded") val scn = scenario("big project benchmark") .repeat(50) { feed(links) .exec( http("request_1") .get("${pageuri}") .headers(headers_1)).pause(1000 millisecond) } setup(scn.inject(ramp(userscount users) on (30 seconds))) .protocols(httpprotocol) .assertions(global.successfulrequests.percent.is(100), details("request_1").responsetime.max.lessthan(1000))
i start in terminal using:
java_opts="-dusers=300" ./gatling.sh -s mypackage.mysimulation -on testing -sd test1
please, patient, because i'm totally new scala , gatling. help.
the problem comes userscount users
part of setup.
in scala, interpreted userscount.users
which, in our case not exist since integer not have users method.
i think (but i'm not sure since cannot test right now), should make userscount int
so: val userscount: int = integer.getinteger("users", 1).toint
.
hope helps!
ps: reason should convert integer
int
because of implicit conversions. powerful feature of scala.
pps: wiki documentation valid gatling 1.x, updated accordingly gatling 2.x
Comments
Post a Comment