problem with using structure element during of Gatling for a long scenario

Hi Gatling Experts

I use gatling-charts-highcharts-2.0.0-bundle

I have a following scenario

class RecordedSimulation extends Simulation {

val uri = “”“http://myserver1:8080/test1"”"

val feeder = csv(“myfile.csv”).queue

val scn = scenario(“RecordedSimulation”)

.feed(feeder)

.exec(http(“request_0”)
.get("""/backapp/index""")
.headers(headers_0))
.pause(1)

.exec(http(“request_1”)
.post("""/backapp/index/process/1""")
.headers(headers_0)
.formParam(""“name”"", “”"${myname}"""))
.pause(1)

.exec(http(“request_77”)
.get(uri+ “”"/images/as/favicon.ico""")
.headers(headers_0))

// I have a total of 77 exec http request like above, so my scenario is very long !!!

setUp(scn.inject(rampUsers(200) over (200 seconds))).protocols(httpProtocol)

}

And I can compile this scenario with no error

But when I want to run my scenario for 15 minutes with 200 Users connected simultaneously

I transform my simulation above like that :

class RecordedSimulation extends Simulation {

val uri = “”“http://myserver1:8080/test1"”"

val feeder = csv(“myfile.csv”).queue

val scn = scenario(“RecordedSimulation”)

during (15 minutes){

.feed(feeder)

.exec(http(“request_0”)
.get("""/backapp/index""")
.headers(headers_0))
.pause(1)

.exec(http(“request_1”)
.post("""/backapp/index/process/1""")
.headers(headers_0)
.formParam(""“name”"", “”"${myname}"""))
.pause(1)

.exec(http(“request_77”)
.get(uri+ “”"/images/as/favicon.ico""")
.headers(headers_0))

}
// I have a total of 77 exec http request like above, so my scenario is very long !!!

setUp(scn.inject(rampUsers(200) over (200 seconds))).protocols(httpProtocol)

}

Therefore, I can not compile my scenario simulation because I always have the message : compilation failed

Have you any idea to help me?

Thanks a lot

Viet Minh

What’s the detail compilation failed message?

Hi Stephane

When I add the lines

.during (15 minutes){

}

in my simulation class , I have the following error messages on the console

D:\gatling-home\gatling-charts-highcharts-2.0.0-bundle\gatling-charts-highcharts
-2.0.0\bin>gatling.bat
GATLING_HOME is set to "D:\gatling-home\gatling-charts-highcharts-2.0.0-bundle\g
atling-charts-highcharts-2.0.0"
Compilation failed
Press any key to continue . . .

D:\gatling-home\gatling-charts-highcharts-2.0.0-bundle\gatling-charts-highcharts
-2.0.0\bin>

But when I remove these lines, I can compile my similation with no error.

I also join the gatling log with this demand for help

gatling_additional-20141011T173447.log (21.4 KB)

Hi Viet Minh,
You said that your scenario is very long and I believe that this the source of your problem.
I tried to reproduce your problem and the only case where I was able to were when my simulation was over the 5000 lines (!!!) mark.
Could you provide your simulation so that I can investigate further, please ?

Cheers,

Pierre

Hi Pierre

Thanks for your help

Here is the code source of my simulation

Can you compile it with during { … chain …} ?

Thanks in advance

Viet Minh

RecordedSimulation.scala (13.9 KB)

Hi Viet Minh,

Looks like you didn’t provide all the information we needed to help you…
There is indeed a compilation error, but unlike what it looks in your first post, there is message providing details on the compilation error, and it’s pretty clear :

12:43:27.541 [ERROR] i.g.a.ZincCompiler$ - /Users/pdalpra/gatling-charts-highcharts-2.0.0/user-files/simulations/RecordedSimulation.scala:54: illegal start of statement
12:43:27.543 [ERROR] i.g.a.ZincCompiler$ - .feed(feeder)
12:43:27.544 [ERROR] i.g.a.ZincCompiler$ - ^
12:43:27.591 [ERROR] i.g.a.ZincCompiler$ - one error found

Just remove the dot before feed in your during loop and it compiles fine.
Just remember that everytime you use “block construct” like during, repeat, tryMax, etc… the first method in the block (in your case feed) do not need a leading dot.

Cheers,

Pierre

Hi Pierre

With your help, It works very well

Again, Thank very much for your help

Cheers

Viet Minh