def matchesExtension(file: File, extensions: Set[String]) =
extensions.exists(ext => file.getName.toLowerCase.contains("." + ext))
def findPaths(root: String, extensions: Set[String]): Array[Map[String, String]] =
findFiles(new File(root))
.filter(matchesExtension(_, extensions))
.map(f => Map("path" -> f.getPath.drop(root.length)))
.toArray
def findFiles(f: File): Stream[File] = f #:: (Stream.empty)
val data = findPaths("/nowhere", Set("txt", "out", "logs")).random
val request = exec(
http("req").get("req?${data}"))
)
val scn = scenario("requests")
.feed(data)
.exec(request)
---->
Simulation ASimulation started...
================================================================================
2014-04-28 15:01:52 0s elapsed
---- requests ------------------------------------------------------------------
[ ] 0%
waiting: 60 / running: 0 / done:0
---- Requests ------------------------------------------------------------------
> Global (OK=0 KO=0 )
================================================================================
15:01:52.424 [ERROR] i.g.h.a.HttpRequestAction - No attribute named 'data' is defined
================================================================================
2014-04-28 15:01:57 5s elapsed
---- requests ------------------------------------------------------------------
[# ] 1%
waiting: 59 / running: 0 / done:1
---- Requests ------------------------------------------------------------------
> Global (OK=0 KO=0 )
================================================================================
15:01:57.529 [ERROR] i.g.c.a.SingletonFeed - Feeder is now empty, stopping engine
15:01:57.530 [ERROR] i.g.h.a.HttpRequestAction - No attribute named 'data' is defined
================================================================================
2014-04-28 15:01:57 5s elapsed
---- requests ------------------------------------------------------------------
[## ] 3%
waiting: 58 / running: 0 / done:2
---- Requests ------------------------------------------------------------------
> Global (OK=0 KO=0 )
================================================================================
Exception in thread "main" java.lang.IllegalStateException: Feeder is now empty, stopping engine
at io.gatling.core.action.SingletonFeed.feed(SingletonFeed.scala:60)
at io.gatling.core.action.SingletonFeed$$anonfun$receive$1.applyOrElse(SingletonFeed.scala:28)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:498)
at akka.actor.ActorCell.invoke(ActorCell.scala:456)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:237)
at akka.dispatch.Mailbox.run(Mailbox.scala:219)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:385)
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)
15:01:57.603 [ERROR] i.g.c.c.Controller$ - Controller hasn't been started
15:01:57.603 [ERROR] i.g.c.c.Controller$ - Controller hasn't been started
15:01:57.603 [ERROR] i.g.c.c.Controller$ - Controller hasn't been started
15:01:57.603 [ERROR] i.g.c.c.Controller$ - Controller hasn't been started
15:01:57.604 [ERROR] i.g.c.c.Controller$ - Controller hasn't been started
15:01:57.604 [ERROR] i.g.c.c.Controller$ - Controller hasn't been started
15:01:57.604 [ERROR] i.g.c.c.Controller$ - Controller hasn't been started
15:01:57.604 [ERROR] i.g.c.c.Controller$ - Controller hasn't been started
15:01:57.604 [ERROR] i.g.c.c.Controller$ - Controller hasn't been started
15:01:57.604 [ERROR] i.g.c.c.Controller$ - Controller hasn't been started
15:01:57.604 [ERROR] i.g.c.c.Controller$ - Controller hasn't been started
15:01:57.604 [ERROR] i.g.c.c.Controller$ - Controller hasn't been started
15:01:57.604 [ERROR] i.g.c.c.Controller$ - Controller hasn't been started
15:01:57.604 [ERROR] i.g.c.c.Controller$ - Controller hasn't been started
15:01:57.604 [ERROR] i.g.c.c.Controller$ - Controller hasn't been started
15:01:57.605 [ERROR] i.g.c.c.Controller$ - Controller hasn't been started
15:01:57.605 [ERROR] i.g.c.c.Controller$ - Controller hasn't been started
...
errors printed 1 for each user in the simulation
--
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/d/optout.