Created
March 9, 2015 17:27
-
-
Save maxdemarzi/c92d42c065171e067b67 to your computer and use it in GitHub Desktop.
Peak Transactions is 64 on my MBP
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
import io.gatling.core.Predef._ | |
import io.gatling.core.scenario.Simulation | |
import io.gatling.http.Predef._ | |
import scala.concurrent.duration._ | |
class CreateNode extends Simulation { | |
val httpConf = http | |
.baseURL("http://localhost:7474") | |
.acceptHeader("application/json") | |
/* Uncomment to see the response of each request. | |
.extraInfoExtractor(extraInfo => { | |
println(extraInfo.response.body.string) | |
Nil | |
}).disableResponseChunksDiscarding | |
*/ | |
// Use a data file for our requests and repeat values if we get to the end. | |
val feeder = csv("usernames.csv").circular | |
val query = """CREATE (me:User {username:{username}})""" | |
val cypherQuery = """{"statements" : [{"statement" : "%s", "parameters" : { "username": "${username}" }}]}""".format(query) | |
val scn = scenario("Get Friends") | |
.repeat(100) { | |
feed(feeder) | |
.exec( | |
http("get friends") | |
.post("/db/data/transaction/commit") | |
.body(StringBody(cypherQuery)) | |
.asJSON | |
.check(status.is(200)) | |
) | |
} | |
setUp( | |
scn.inject(rampUsers(100) over(10 seconds)).protocols(httpConf) | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment