Created
June 7, 2012 11:04
-
-
Save krishnenc/2888230 to your computer and use it in GitHub Desktop.
Redis Feed added to Gatling DSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package other | |
import com.excilys.ebi.gatling.core.Predef._ | |
import com.excilys.ebi.gatling.http.Predef._ | |
import com.excilys.ebi.gatling.jdbc.Predef._ | |
import com.excilys.ebi.gatling.http.Headers.Names._ | |
import com.excilys.ebi.gatling.redis.Predef.redisFeeder | |
import akka.util.duration._ | |
import bootstrap._ | |
import com.redis._ | |
import serialization._ | |
class RedisSimulation extends Simulation { | |
val redisPool = new RedisClientPool("localhost", 6379) | |
def apply = { | |
val urlBase = "http://192.168.1.132:88" | |
val httpConf = httpConfig.baseURL(urlBase) | |
val scn = scenario("Scenario name") | |
.feed(redisFeeder(redisPool, "URLS")) | |
.repeat(10) { | |
exec((session: Session) => { | |
http("request_redis") | |
.get("/inject_mo?${URLS}") | |
session | |
}) | |
.pause(7, 8) | |
} | |
List(scn.configure.users(10).ramp(10).protocolConfig(httpConf)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment