I’m not seeing detail on this on gatling.io or in the Gatling 2.3 to 3.0 transition docs. Really appreciate it if you could tell me how I could translate something like this →
val numberOfDays = 1
val duration = (1 minute);
val stagesPerDay = 24;
val relativeRateIncreasePerDay = 0.2;
val stretchFactor = 10
var steps = MutableListInjectionStep
for (day ← 1 to numberOfDays) {
for (s ← 1 to stagesPerDay) {
val x = 2 * math.Pi * s / stagesPerDay
val rate = stretchFactor * math.sin(x) * (1 + day * relativeRateIncreasePerDay)
if (rate > 0.1) {
println(rate);
steps += (constantUsersPerSec(rate) during (duration))
}
}
}
Would you mind showing me a short snippet of what you’re getting at using for comprehension to avoid Gatling types. I’ve read up on for comprehensions, maps, fold, etc. I get the basic concepts i’m just not seeing a path forward for this implementation. Appreciate any insight.
val steps =
for {
day <- 1 to numberOfDays
s <- 1 to stagesPerDay
x = 2 * math.Pi * s / stagesPerDay
rate = stretchFactor * math.sin(x) * (1 + day * relativeRateIncreasePerDay)
step =
if (rate > 0.1) {
constantUsersPerSec(rate) during duration
} else {
nothingFor(0)
}
} yield step
Merci beaucoup. Please tell me where in the city center I can buy you an apéritif.
It would be great if stuff like this could be evangelized on the gatling.io site. I realize it may be trivial, but i’ve noticed many people trying to use Gatling whom have never used Scala, asking questions and people spending time they shouldn’t have to on resolution. I also think stuff like this would promote best practices and reinforce premium usage of Gatling. Further, it surprises me that a company like EA which I showed an example of is using and publicizing code that could have been written more elegantly as you’ve shown.
Merci beaucoup. Please tell me where in the city center I can buy you an apéritif.
You’ll have to fly to Paris
It would be great if stuff like this could be evangelized on the gatling.io site. I realize it may be trivial, but i’ve noticed many people trying to use Gatling whom have never used Scala, asking questions and people spending time they shouldn’t have to on resolution. I also think stuff like this would promote best practices and reinforce premium usage of Gatling.
Further, it surprises me that a company like EA which I showed an example of is using and publicizing code that could have been written more elegantly as you’ve shown.
Well, I guess the little the people who wrote this code know about Scala suffices for their Gatling needs. Plus it works for them.