Hi everyone,
I’m trying to build a configurable scenario. I want the tester to be able to configure the number of loops but at execution time I get this ouput:
[INFO] --- gatling-maven-plugin:2.1.6:execute (default-cli) @ hawkular-metrics-load-tests --- 10:43:15.156 [main][ERROR][ZincCompiler.scala:108] i.g.c.ZincCompiler$ - /home/tsegismont/Projets/hawkular-metrics/load-tests/src/test/scala/org/hawkular/metrics/loadtest/MetricsSimulation.scala:25: type mismatch; found : Integer required: io.gatling.core.session.Expression[Int] (which expands to) io.gatling.core.session.Session => io.gatling.core.validation.Validation[Int] 10:43:15.161 [main][ERROR][ZincCompiler.scala:108] i.g.c.ZincCompiler$ - val simulation = repeat(loops, "n") { 10:43:15.163 [main][ERROR][ZincCompiler.scala:108] i.g.c.ZincCompiler$ - ^ 10:43:15.530 [main][ERROR][ZincCompiler.scala:108] i.g.c.ZincCompiler$ - one error found
I’m sure it’s something stupid but I have zero Scala knowledge…
Here’s my simulation file:
`
package org.hawkular.metrics.loadtest
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
class MetricsSimulation extends Simulation {
val baseURI = System.getProperty(“baseURI”, “http://localhost:8080”)
val clients = Integer.getInteger(“clients”, 1)
val ramp = java.lang.Long.getLong(“ramp”, 0L)
val loops = Integer.getInteger(“loops”, 1000)
val interval = Integer.getInteger(“interval”, 1)
val httpProtocol = http
.baseURL(baseURI)
.header(“Hawkular-Tenant”, “default”)
.contentTypeHeader(“application/json;charset=utf-8”)
val simulation = repeat(loops, “n”) {
exec(http(“Report ${n}”)
.post("/hawkular/metrics/gauges/data")
.body(ELFileBody(“body.json”)).asJSON
).pause(interval)
}
val scn = scenario(“MetricsSimulation”).exec(simulation)
setUp(scn.inject(rampUsers(clients) over (ramp seconds))).protocols(httpProtocol)
}
`
Thanks in advance for your help and the awesome tool!
Best regards,
Thomas