Created
March 6, 2015 06:27
-
-
Save infomaven/96adc6d066b7fa8b36b9 to your computer and use it in GitHub Desktop.
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 sensorData | |
import io.gatling.core.Predef._ | |
import io.gatling.http.Predef._ | |
import io.gatling.jdbc.Predef._ // maybe not needed? | |
import scala.concurrent.duration._ | |
import com.redis._ | |
import io.gatling.redis.feeder._ | |
object MyProtocol { | |
val httpProtocol = http | |
.baseURL("http://localhost") | |
// .extraInfoExtractor((requestStatus, session, request, response) => List.empty) | |
// .dumpSessionOnFailure | |
.disableFollowRedirect | |
.warmUp("http://localhost") | |
// .disableWarmUp | |
} | |
object RedisTestScenario { | |
val redisPool = new RedisClientPool("localhost", 6379) | |
val scn = scenario("RedisTest") | |
.repeat(2) { | |
feed(RedisFeeder(redisPool, "wordList", RedisFeeder.LPOP)) | |
.exec( | |
http("redis_test_request") | |
.post("/") | |
.body(StringBody("${wordList}")) | |
.check(status.is(200)) | |
) | |
.pause(0 milliseconds, 100 milliseconds) | |
} | |
} | |
class RedisDataTest extends Simulation { | |
setUp(RedisTestScenario.scn.inject | |
(nothingFor(4 seconds), rampUsers(2) over (10 seconds), nothingFor(1 second)) | |
) | |
.protocols(MyProtocol.httpProtocol) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment