Re: [Gatling List] using pause value from csv file

154 views
Skip to first unread message

Stéphane Landelle

unread,
Feb 3, 2013, 7:44:52 AM2/3/13
to gat...@googlegroups.com
Hi Peter,

Sadly, pauses are not currently dynamic.
Can you open an issue, please?

Cheers,

Stéphane



2013/1/28 Peter Lynch <pe...@peterlynch.ca>
The urls for my scenario requests are in a csv feeder file. 

I want to make the pause between requests configurable from a csv file as well. My goal is to have a predictable pause after each request for every simulation run.

It appears I cannot have something like this evaluate properly

.pause("${pause}".toLong milliseconds)

Is there any other way to get the pause value from the csv file?

-Peter

--
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.
 
 

Nicolas Rémond

unread,
Feb 27, 2013, 12:51:44 PM2/27/13
to gat...@googlegroups.com
Hi,

This point is now discussed in the following pull-request : https://github.com/excilys/gatling/pull/979

cheers
Nicolas

Grégory Bougeard

unread,
Mar 4, 2015, 9:22:13 AM3/4/15
to gat...@googlegroups.com
Is it operational?

I'm trying to define the pause through a value in my feeder but I always have  [ERROR] i.g.c.a.Pause - 'pause-2' failed to execute

I tried to type the value as String, Int, Long or Duration but I always have this error.
Is my code wrong or is there an issue elsewhere?

Grégory Bougeard

unread,
Mar 4, 2015, 9:25:46 AM3/4/15
to gat...@googlegroups.com
with some code

val records = customSeparatorFeeder.records
val fmt = ISODateTimeFormat.dateTime()
val feeder = records.sliding(2).map { case Seq(line1, line2) =>
// println(s"record $line1")
val t1 = line1.apply("timestamp")
val t2 = line2.apply("timestamp")
val dt1 = fmt.parseDateTime(t1)
val dt2 = fmt.parseDateTime(t2)
val diff = Math.abs(dt2.getMillis - dt1.getMillis)
// println(s"diff t2 $t2 - t1 $t1 = $diff")

val url = line1.apply("request").split(' ').get(1).substring(prodSite.length)
// println(url)

val r = Map("pause" -> (diff milliseconds), "url" -> url, "module" -> url.split('/').head)
print(s"$r")
r
}

val scn = scenario("test") // A scenario is a chain of requests and pauses
.repeat(10, "n") {
feed(feeder)
.exec(http("${module}")
.get("${url}"))
.pause("${pause}")
}

setUp(scn.inject(atOnceUsers(1)).protocols(httpConf))
Reply all
Reply to author
Forward
0 new messages