Hi all.
I need to stress test a service that have a strong caching mechanism.
Because of that I need to add some random num to the parameter value I get from CSV via feeder.
How can I do it in gatling?
I tried the following:
def getRand(i: Int) : String = ThreadLocalRandom.current.nextInt(i).toString
val httpProtocol = http.baseURL(“http://media.mtvnservices-d.mtvi.com/pmt/e1/director/dte_devices_test.php”)
.proxy(“localhost”, 8888)
val scn = scenario(“Devices.esi test”)
.feed(csv(“useragents.csv”).circular)
.exec(http(“test”).get("/")
.header(“User-Agent”, “${UserAgent}”.concat(_ => getRand(1000000)))
.check(status.is(200))
)
.pause(1, 2)
Thanks in advance!