Compilation failure - HTTP DELETE on body

I am a first time user of Gatling and trying to compile a recorded test. It is failing to compile. I have tried a couple of thing and received the same error message.

I appreciate someone giving me some insight into this compile issue.

Using Gatling version 2.0.0-M3a

Error message:
22:21:35.902 [ERROR] i.g.a.ZincCompiler$ - C:\jl\sw\Java\gatling-charts-highcharts-2.0.0-M3a\user-files\simulations\RabbitLogin2.scala:218: value body is not amember of io.gatling.http.request.builder.DeleteHttpRequestBuilder possible cause: maybe a semicolon is missing before `value body’?
22:21:35.905 [ERROR] i.g.a.ZincCompiler$ - .body(“xxx”)
22:21:35.906 [ERROR] i.g.a.ZincCompiler$ - ^
22:21:36.296 [ERROR] i.g.a.ZincCompiler$ - one error found
Exception in thread “main” Compilation failed
at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:105)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:48)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:41)
at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply$mcV$sp(AggressiveCompile.scala:98)
at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:98)
at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:98)
at sbt.compiler.AggressiveCompile.sbt$compiler$AggressiveCompile$$timed(AggressiveCompile.scala:155)
at sbt.compiler.AggressiveCompile$$anonfun$3.compileScala$1(AggressiveCompile.scala:97)
at sbt.compiler.AggressiveCompile$$anonfun$3.apply(AggressiveCompile.scala:138)
at sbt.compiler.AggressiveCompile$$anonfun$3.apply(AggressiveCompile.scala:86)
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:30)
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:28)
at sbt.inc.Incremental$.cycle(Incremental.scala:73)
at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:33)
at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:32)
at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:41)
at sbt.inc.Incremental$.compile(Incremental.scala:32)
at sbt.inc.IncrementalCompile$.apply(Compile.scala:25)
at sbt.compiler.AggressiveCompile.compile2(AggressiveCompile.scala:146)
at sbt.compiler.AggressiveCompile.compile1(AggressiveCompile.scala:70)
at com.typesafe.zinc.Compiler.compile(Compiler.scala:161)
at com.typesafe.zinc.Compiler.compile(Compiler.scala:142)
at io.gatling.app.ZincCompiler$.main(ZincCompiler.scala:111)
at io.gatling.app.ZincCompiler.main(ZincCompiler.scala)
Exception in thread “main” org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:377)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:160)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:147)
at io.gatling.app.ZincCompilerLauncher$.apply(ZincCompilerLauncher.scala:54)
at io.gatling.app.SimulationClassLoader$.fromSourcesDirectory(SimulationClassLoader.scala:32)
at io.gatling.app.Gatling$$anonfun$15.apply(Gatling.scala:171)
at io.gatling.app.Gatling$$anonfun$15.apply(Gatling.scala:171)
at scala.Option.getOrElse(Option.scala:120)
at io.gatling.app.Gatling.start(Gatling.scala:171)
at io.gatling.app.Gatling$.fromMap(Gatling.scala:59)
at io.gatling.app.Gatling$.runGatling(Gatling.scala:80)
at io.gatling.app.Gatling$.main(Gatling.scala:54)
at io.gatling.app.Gatling.main(Gatling.scala)

thanks,
-john

RabbitLogin2.scala (6.62 KB)

Hi,

Sadly, this is a bug in 2M3a, we missed the point that it was possible to set a body on a DELETE request, so it was not possible to use setBody after bootstrapping a request definition with delete.
This has been fixed in master: https://github.com/excilys/gatling/issues/1455

I see 2 solutions:

  1. use a snapshot of the next version: https://oss.sonatype.org/content/repositories/snapshots/io/gatling/highcharts/gatling-charts-highcharts/2.0.0-SNAPSHOT/
  2. fork the existing DeleteHttpRequestBuilder in make it support setting a body, just like PutHttpRequestBuilder:
    https://github.com/excilys/gatling/blob/2.0.0-M3a/gatling-http/src/main/scala/io/gatling/http/request/builder/DeleteHttpRequestBuilder.scala

https://github.com/excilys/gatling/blob/2.0.0-M3a/gatling-http/src/main/scala/io/gatling/http/request/builder/PutHttpRequestBuilder.scala

Basically, you just have to make it extend AbstractHttpRequestWithBodyBuilder instead of AbstractHttpRequestBuilder.

Tell me if you need help.

Cheers,

Stéphane

I documented the workaround in the issue: https://github.com/excilys/gatling/issues/1455#issuecomment-27553819

I will play around with it and give an update.

Thanks,
-john

I pulled down the 2.0.0-SNAPSHOT bundle and tried to startup. This time I have more compilation failures. Here is the output without any modification to the test.

11:27:59.918 [ERROR] i.g.a.ZincCompiler$ - C:\jl\sw\Java\gatling-charts-highcharts-2.0.0-SNAPSHOT\user-files\simulations\RabbitLogin2.scala:6: object Headers is not a member of package io.gatling.http
11:27:59.920 [ERROR] i.g.a.ZincCompiler$ - import io.gatling.http.Headers.Names._
11:27:59.921 [ERROR] i.g.a.ZincCompiler$ - ^
11:27:59.925 [ERROR] i.g.a.ZincCompiler$ - C:\jl\sw\Java\gatling-charts-highcharts-2.0.0-SNAPSHOT\user-files\simulations\RabbitLogin2.scala:7: object Headers is not a member of package io.gatling.http
11:27:59.925 [ERROR] i.g.a.ZincCompiler$ - import io.gatling.http.Headers.Values._
11:27:59.925 [ERROR] i.g.a.ZincCompiler$ - ^
11:27:59.943 [ERROR] i.g.a.ZincCompiler$ - C:\jl\sw\Java\gatling-charts-highcharts-2.0.0-SNAPSHOT\user-files\simulations\RabbitLogin2.scala:9: not found: object bootstrap
11:27:59.943 [ERROR] i.g.a.ZincCompiler$ - import bootstrap._
11:27:59.943 [ERROR] i.g.a.ZincCompiler$ - ^
11:27:59.944 [ERROR] i.g.a.ZincCompiler$ - C:\jl\sw\Java\gatling-charts-highcharts-2.0.0-SNAPSHOT\user-files\simulations\RabbitLogin2.scala:10: not found: object assertions
11:27:59.944 [ERROR] i.g.a.ZincCompiler$ - import assertions._
11:27:59.944 [ERROR] i.g.a.ZincCompiler$ - ^
11:28:02.927 [ERROR] i.g.a.ZincCompiler$ - C:\jl\sw\Java\gatling-charts-highcharts-2.0.0-SNAPSHOT\user-files\simulations\RabbitLogin2.scala:225: not found: value atOnce
11:28:02.927 [ERROR] i.g.a.ZincCompiler$ - setUp(scn.inject(atOnce(1 user))).protocols(httpProtocol)
11:28:02.927 [ERROR] i.g.a.ZincCompiler$ - ^
11:28:02.947 [ERROR] i.g.a.ZincCompiler$ - C:\jl\sw\Java\gatling-charts-highcharts-2.0.0-SNAPSHOT\user-files\simulations\RecordedSimulation.scala:6: object Headers is not a member of package io.gatling.http
11:28:02.947 [ERROR] i.g.a.ZincCompiler$ - import io.gatling.http.Headers.Names._
11:28:02.947 [ERROR] i.g.a.ZincCompiler$ - ^
11:28:02.949 [ERROR] i.g.a.ZincCompiler$ - C:\jl\sw\Java\gatling-charts-highcharts-2.0.0-SNAPSHOT\user-files\simulations\RecordedSimulation.scala:7: object Headers is not a member of package io.gatling.http
11:28:02.949 [ERROR] i.g.a.ZincCompiler$ - import io.gatling.http.Headers.Values._
11:28:02.949 [ERROR] i.g.a.ZincCompiler$ - ^
11:28:02.951 [ERROR] i.g.a.ZincCompiler$ - C:\jl\sw\Java\gatling-charts-highcharts-2.0.0-SNAPSHOT\user-files\simulations\RecordedSimulation.scala:9: not found: object bootstrap
11:28:02.951 [ERROR] i.g.a.ZincCompiler$ - import bootstrap._
11:28:02.951 [ERROR] i.g.a.ZincCompiler$ - ^
11:28:02.952 [ERROR] i.g.a.ZincCompiler$ - C:\jl\sw\Java\gatling-charts-highcharts-2.0.0-SNAPSHOT\user-files\simulations\RecordedSimulation.scala:10: not found: object assertions
11:28:02.952 [ERROR] i.g.a.ZincCompiler$ - import assertions._
11:28:02.953 [ERROR] i.g.a.ZincCompiler$ - ^
11:28:03.019 [ERROR] i.g.a.ZincCompiler$ - C:\jl\sw\Java\gatling-charts-highcharts-2.0.0-SNAPSHOT\user-files\simulations\RecordedSimulation.scala:26: not found: value atOnce
11:28:03.019 [ERROR] i.g.a.ZincCompiler$ - setUp(scn.inject(atOnce(1 user))).protocols(httpProtocol)
11:28:03.019 [ERROR] i.g.a.ZincCompiler$ - ^
11:28:03.023 [ERROR] i.g.a.ZincCompiler$ - C:\jl\sw\Java\gatling-charts-highcharts-2.0.0-SNAPSHOT\user-files\simulations\advanced\AdvancedExampleSimulation.scala:6: object Headers is not a member of package io.gatling.http
11:28:03.024 [ERROR] i.g.a.ZincCompiler$ - import io.gatling.http.Headers.Names._
11:28:03.024 [ERROR] i.g.a.ZincCompiler$ - ^
11:28:03.036 [ERROR] i.g.a.ZincCompiler$ - C:\jl\sw\Java\gatling-charts-highcharts-2.0.0-SNAPSHOT\user-files\simulations\advanced\SomeScenario.scala:6: not found: object bootstrap
11:28:03.036 [ERROR] i.g.a.ZincCompiler$ - import bootstrap._
11:28:03.036 [ERROR] i.g.a.ZincCompiler$ - ^
11:28:03.986 [ERROR] i.g.a.ZincCompiler$ - C:\jl\sw\Java\gatling-charts-highcharts-2.0.0-SNAPSHOT\user-files\simulations\advanced\AdvancedExampleSimulation.scala:13: not found: value ramp
11:28:03.986 [ERROR] i.g.a.ZincCompiler$ - setUp(SomeScenario.scn.inject(ramp(10 users) over (10 seconds)),
11:28:03.986 [ERROR] i.g.a.ZincCompiler$ - ^
11:28:04.000 [ERROR] i.g.a.ZincCompiler$ - C:\jl\sw\Java\gatling-charts-highcharts-2.0.0-SNAPSHOT\user-files\simulations\basic\BasicExampleSimulation.scala:6: object Headers is not a member of package io.gatling.http
11:28:04.000 [ERROR] i.g.a.ZincCompiler$ - import io.gatling.http.Headers.Names._
11:28:04.000 [ERROR] i.g.a.ZincCompiler$ - ^
11:28:04.002 [ERROR] i.g.a.ZincCompiler$ - C:\jl\sw\Java\gatling-charts-highcharts-2.0.0-SNAPSHOT\user-files\simulations\basic\BasicExampleSimulation.scala:8: not found: object bootstrap
11:28:04.002 [ERROR] i.g.a.ZincCompiler$ - import bootstrap._
11:28:04.002 [ERROR] i.g.a.ZincCompiler$ - ^
11:28:04.003 [ERROR] i.g.a.ZincCompiler$ - C:\jl\sw\Java\gatling-charts-highcharts-2.0.0-SNAPSHOT\user-files\simulations\basic\BasicExampleSimulation.scala:9: not found: object assertions
11:28:04.003 [ERROR] i.g.a.ZincCompiler$ - import assertions._
11:28:04.003 [ERROR] i.g.a.ZincCompiler$ - ^
11:28:04.446 [ERROR] i.g.a.ZincCompiler$ - C:\jl\sw\Java\gatling-charts-highcharts-2.0.0-SNAPSHOT\user-files\simulations\basic\BasicExampleSimulation.scala:93: not found: value ramp
11:28:04.446 [ERROR] i.g.a.ZincCompiler$ - setUp(scn.inject(ramp(3 users) over (10 seconds)))
11:28:04.446 [ERROR] i.g.a.ZincCompiler$ - ^
11:28:04.456 [ERROR] i.g.a.ZincCompiler$ - 17 errors found
Compilation failed

After removing the provided example tests and modifying my test (commenting out imports for io.gatling.http.Headers.Names., io.gatling.http.Headers.Values., bootstrap., and assertions.), I get the following error

11:47:46.298 [ERROR] i.g.a.ZincCompiler$ - C:\jl\sw\Java\gatling-charts-highcharts-2.0.0-SNAPSHOT\user-files\simulations\RabbitLogin2.scala:217: not found: value atOnce
11:47:46.300 [ERROR] i.g.a.ZincCompiler$ - setUp(scn.inject(atOnce(1 user))).protocols(httpProtocol)
11:47:46.301 [ERROR] i.g.a.ZincCompiler$ - ^
11:47:46.333 [ERROR] i.g.a.ZincCompiler$ - one error found
Compilation failed

Headers.Names => HeaderNames

Headers.Values => HeaderValues

bootstrap._ => removed

assertions._ => removed

atOnce(1 user) => atOnceUsers(1)

ramp(3 users) => rampUsers(3)

Thanks. I made the updates and I am able to run the test.

Cool!

Hi

I am new to scala gatling . I have created a simulator file for running my load test for a get api. But i get the below exception

ERROR:

GATLING_HOME is set to /home/shishirchandra/gatling-charts-highcharts-1.5.1
16:27:15.455 [ERROR] c.e.e.g.a.ZincCompiler$ - /home/shishirchandra/gatling-charts-highcharts-1.5.1/user-files/simulations/carb/GetPromotedAppsSimulation.scala:32: not found: value setUp
16:27:15.459 [ERROR] c.e.e.g.a.ZincCompiler$ - setUp(scn.users(600).ramp(200).protocols(httpConf))
16:27:15.460 [ERROR] c.e.e.g.a.ZincCompiler$ - ^
16:27:15.478 [ERROR] c.e.e.g.a.ZincCompiler$ - one error found
Exception in thread “main” Compilation failed

Your class should extend Simulation.
Then, the bootstrap._ import is missing.

As a starter, you should read the documentation, and use the Recorder to get some samples and get more familiar with the Simulation class structure.

Thanks Stephane, That worked but now I am stucked probably at the next step.

I now get

GATLING_HOME is set to /home/shishirchandra/gatling-charts-highcharts-1.5.1
17:16:34.717 [ERROR] c.e.e.g.a.ZincCompiler$ - /home/shishirchandra/gatling-charts-highcharts-1.5.1/user-files/simulations/carb/GetPromotedAppsSimulation.scala:35: value protocols is not a member of Unit
17:16:34.720 [ERROR] c.e.e.g.a.ZincCompiler$ - setUp(scn.users(600).ramp(200)).protocols(httpConf)
17:16:34.721 [ERROR] c.e.e.g.a.ZincCompiler$ - ^
17:16:34.743 [ERROR] c.e.e.g.a.ZincCompiler$ - one error found
Exception in thread “main” Compilation failed

You’re trying to use Gatling 2 syntax with Gatling 1.
https://github.com/excilys/gatling/wiki/HTTP#wiki-protocol-config

This is there I referred from and wrote my code.

Also when I include GATLING_HOME is set to /home/shishirchandra/gatling-charts-highcharts-1.5.1
17:22:25.777 [ERROR] c.e.e.g.a.ZincCompiler$ - /home/shishirchandra/gatling-charts-highcharts-1.5.1/user-files/simulations/carb/GetPromotedAppsSimulation.scala:3: object gatling is not a member of package io
17:22:25.780 [ERROR] c.e.e.g.a.ZincCompiler$ - import io.gatling.core.Predef._
17:22:25.781 [ERROR] c.e.e.g.a.ZincCompiler$ - ^
17:22:25.976 [ERROR] c.e.e.g.a.ZincCompiler$ - one error found
Exception in thread “main” Compilation failed

protocolConfig(httpConf)) worked for me, Thanks :slight_smile:

How can I setup the request per seconds, For example if I am looking to test my application against a load of 1200 requests per second for 20 minutes.

Thanks

That’s throttle and will be in next release.
https://github.com/excilys/gatling/issues/625

Hi ,

Needed help regarding how do I set my simulation to repeat or to run it for a duration of say 3 hours. I have the following simulation and I would like to repeat it for say 20 times.

package custom.protocol.test

import com.excilys.ebi.gatling.core.scenario.configuration.Simulation
import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
import bootstrap._
import assertions._
import scala.concurrent.duration._

class GetPromotedAppsSimulation extends Simulation {

val httpConf = httpConfig
.baseURL(“http://10.14.118.225:8080/carb/v1/app_relevance”)
.acceptHeader(“text/javascript, text/html, application/xml, text/xml, /”)
.acceptEncodingHeader(“gzip,deflate,sdch”)

val headers_1 = Map(
“Keep-Alive” → “200000”)

.
val scn = scenario(“Gatling GetPromotedApps”)

.exec(http(“request_1”)
.get("?")
.queryParam(“ip”, “74.125.236.197”)
.queryParam(“h-user-agent”, “Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10A403”)
.queryParam(“u-id-map”, “o0TQ4Zzo12TJ8XEfn/Kl1tWNW57TePzy6v/vM3ms+AOULj/MgGguisKXobgrXlFM2KPxafDmt9l6IFdNDsvGupAaUhM0wMqNFTByFM9YSLnynkvq6Ox1/3GewvIPK4PcVc0ygZnso3a4b1Gahast8gcFAGfVdxsMHVhwCfj1HlJPfUhD+HymGc9bhOaM2BmdOOOekdcKHSBoK5zSW6wfqMWgTnjkH43VcemcwQDoO3FoA5CBdxKViwrv8Yf7c66otO/mYYrFhLljubEIEHGsNYJTdWiJ+FaRQ1dXbbK14fce8niJeUFDYDj2Og7uwwyGBsy1tZvZSzHoLwX7RQdvj2xNNt/unEsVB5B/aHl6KCo88bGCRUZeXgwPxIM2uE34pwAsbU+KgWOXnbzZ0is5XdbpWe5HYUv3KN5Edv08CqM=”)
.queryParam(“u-id-key”, “3421782114”)

.check(status.is(200)))

.pause(0)

setUp(scn.users(10).ramp(1).protocolConfig(httpConf))
;assertThat(global.responseTime.max.lessThan(100))

}

Thanks for the help!!!

Please read the documention:
https://github.com/excilys/gatling/wiki/Structure-Elements#repeat

https://github.com/excilys/gatling/wiki/Structure-Elements#during

Got that working,

Thanks

Hi

I am using gatling to hit a get endpoint, But currently I was doing it with a fixed query param, But now I desire to generate the load with random set of values for the parameters in my get call.
Example:
currently I have a query param say, x:abc. But now I want x to be assigned with not only abc but some other possible values randomly and generate the load in order to overcome the latency reduction due to caching on the server.

Thanks,
Shishir