the correct way to use request groups in gatling2 M3a

2,691 views
Skip to first unread message

Vova Polishchuk

unread,
Jul 29, 2013, 9:55:02 AM7/29/13
to gat...@googlegroups.com
hi again, i used the convenient way of grouping requests in gatling 1 and would like to do something like that now.

but  when i do something like 

 val scn = scenario("Some scenario")
 group("group 1") {
    exec(http("Open page")
      .get("/page")
      .headers(headers_73))
      .pause(0, 7)
  }
  .group("other page") {
    exec(http("Open other page")
      .get("/promotions")
      .headers(headers_73)
    )
  }

the result is 



Simulation wpl20.TestScenario started...

16:45:13.737 [DEBUG] o.j.n.c.s.n.SelectorUtil - Using select timeout of 500
16:45:13.741 [DEBUG] o.j.n.c.s.n.SelectorUtil - Epoll-bug workaround enabled = false
16:45:14.119 [DEBUG] o.j.n.c.DefaultChannelFuture - The dead lock checker in DefaultChannelFuture has been disabled as requested at your own risk.
16:45:14.201 [DEBUG] c.n.h.c.p.n.NettyAsyncHttpProvider - 
Non cached request 
DefaultHttpRequest(chunked: false)
GET /KQUcD HTTP/1.1
Host: goo.gl
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Connection: keep-alive
Accept-Encoding: gzip
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0

using Channel 
[id: 0xc0a4efa7]

16:45:14.302 [DEBUG] c.n.h.c.p.n.NettyAsyncHttpProvider - 

Request DefaultHttpRequest(chunked: false)
GET /KQUcD HTTP/1.1
Host: goo.gl
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Connection: keep-alive
Accept-Encoding: gzip
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0

Response DefaultHttpResponse(chunked: false)
HTTP/1.1 301 Moved Permanently
Content-Type: text/html; charset=UTF-8
Pragma: no-cache
Expires: Mon, 01 Jan 1990 00:00:00 GMT
Date: Mon, 29 Jul 2013 13:43:10 GMT
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Age: 124
Content-Length: 214

16:45:14.304 [DEBUG] c.n.h.c.p.n.NettyConnectionsPool - Adding uri: http://goo.gl:80 for channel [id: 0xc0a4efa7, /172.29.46.144:56089 => goo.gl/173.194.112.196:80]
16:45:14.319 [INFO ] i.g.c.r.Runner - Total number of users : 1
16:45:14.323 [INFO ] i.g.c.r.t.Terminator - Initializing
16:45:14.324 [INFO ] i.g.c.r.t.Terminator - Expecting 1 EndUser messages to terminate
16:45:14.324 [INFO ] i.g.c.r.t.Terminator - Initialized
16:45:14.336 [INFO ] i.g.c.r.w.FileDataWriter - Initializing
16:45:14.337 [INFO ] i.g.c.r.w.ConsoleDataWriter - Initializing
16:45:14.340 [INFO ] i.g.c.r.t.Terminator - DataWriter registered
16:45:14.340 [INFO ] i.g.c.r.t.Terminator - DataWriter registered
16:45:14.340 [INFO ] i.g.c.r.w.FileDataWriter - Going on with initialization after Terminator registration
16:45:14.341 [INFO ] i.g.c.r.w.ConsoleDataWriter - Going on with initialization after Terminator registration
16:45:14.349 [INFO ] i.g.c.r.w.ConsoleDataWriter - Initialized
16:45:14.350 [INFO ] i.g.c.r.w.FileDataWriter - Initialized
16:45:14.351 [DEBUG] i.g.c.r.Runner - Launching All Scenarios
16:45:14.358 [DEBUG] i.g.c.r.Runner - Finished Launching scenarios executions
16:45:14.362 [INFO ] i.g.c.a.UserStart - Start user #0
16:45:14.364 [INFO ] i.g.c.a.UserEnd - End user #0
16:45:14.367 [INFO ] i.g.c.r.t.Terminator - Asking DataWriters to flush

================================================================================
2013-07-29 16:45:14                                           0s elapsed
---- Login and Navigation ------------------------------------------------------
[##########################################################################]100%
          waiting: 0      / running: 0      / done:1     
---- Requests ------------------------------------------------------------------
> Global                                                   (OK=0      KO=0     )

================================================================================

Simulation finished.
Generating reports...
Parsing log file(s)...
16:45:14.411 [INFO ] i.g.c.r.r.FileDataReader - Collected List(C:\Users\volodymyrp\IdeaWorkplace\gatling2\target\results\testscenario-20130729164512\simulation.log) from testscenario-20130729164512
[ERROR] [07/29/2013 16:45:14.410] [GatlingSystem-akka.actor.default-dispatcher-4] [akka://GatlingSystem/user/$d] Actor ConsoleDataWriter doesn't support message Display
java.lang.IllegalArgumentException: Actor ConsoleDataWriter doesn't support message Display
at io.gatling.core.action.BaseActor.unhandled(Actions.scala:30)
at akka.actor.ActorCell$$anonfun$receiveMessage$1.apply(ActorCell.scala:425)
at akka.actor.ActorCell$$anonfun$receiveMessage$1.apply(ActorCell.scala:425)
at io.gatling.core.result.writer.DataWriter$$anonfun$uninitialized$1.applyOrElse(DataWriter.scala:66)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:425)
at akka.actor.ActorCell.invoke(ActorCell.scala:386)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:230)
at akka.dispatch.Mailbox.run(Mailbox.scala:212)
at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:506)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

16:45:14.415 [INFO ] i.g.c.r.r.FileDataReader - First pass
16:45:14.422 [INFO ] i.g.c.r.r.FileDataReader - First pass done: read 2 lines
16:45:14.429 [INFO ] i.g.c.r.r.FileDataReader - Second pass
16:45:14.468 [INFO ] i.g.c.r.r.FileDataReader - Second pass: read 2 lines


Stéphane Landelle

unread,
Jul 29, 2013, 9:57:27 AM7/29/13
to gat...@googlegroups.com
Hi,

Which version do you use?


2013/7/29 Vova Polishchuk <liberat...@gmail.com>


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Stéphane Landelle

unread,
Jul 29, 2013, 9:58:04 AM7/29/13
to gat...@googlegroups.com
Sorry, it was in the title.


2013/7/29 Stéphane Landelle <slan...@excilys.com>

Stéphane Landelle

unread,
Jul 29, 2013, 10:02:20 AM7/29/13
to gat...@googlegroups.com
That's just a race condition with the timer asking to display the console info one last time just after it was asked for shutdown.
Just ignore it, we'll clean this up in the next release.

Thanks for reporting.


2013/7/29 Stéphane Landelle <slan...@excilys.com>

Vova Polishchuk

unread,
Jul 29, 2013, 10:13:20 AM7/29/13
to gat...@googlegroups.com
thank you for fast reply

but i expect the scenarios to actually send requests ) and they dont do that if i try to use groups

here is an example scenario

package wpl20

import io.gatling.http.Predef._
import io.gatling.core.scenario.Simulation
import io.gatling.core.Predef._
import scala.concurrent.duration._
import bootstrap._
import assertions._

class TestScenario extends Simulation {

  val httpConf = http
    .baseURL("http://edition.cnn.com")
    .acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
    .acceptEncodingHeader("gzip, deflate")
    .acceptLanguageHeader("en-US,en;q=0.5")
    .connection("keep-alive")
    .userAgentHeader("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36")
    .disableFollowRedirect


  val scn = scenario("Navigation")
  group("Home page") {
    exec(http("Open home page")
      .get("/")
      .headers(headers_73))
      .pause(0, 7)
  }
    group("world page") {
    exec(http("Open world page")
      .get("/WORLD/")
      .headers(headers_73)
    )
  }


  setUp(scn.inject(ramp(2 users) over (30 seconds))).protocols(httpConf)

Stéphane Landelle

unread,
Jul 29, 2013, 10:18:49 AM7/29/13
to gat...@googlegroups.com
There's dots missing in front of your group method calls (just like in Gatling 1).

val scn = scenario("Navigation")
  .group("Home page") {
    exec(http("Open home page")
      .get("/")
      .headers(headers_73))
      .pause(0, 7)
  }
    .group("world page") {
    exec(http("Open world page")
      .get("/WORLD/")
      .headers(headers_73)
    )
  }



2013/7/29 Vova Polishchuk <liberat...@gmail.com>
Reply all
Reply to author
Forward
0 new messages