-
-
Save ivankatliarchuk/18c6506816a11e3264fe62b5be42e45d to your computer and use it in GitHub Desktop.
Benchmarks for Gatling: Gatling's simulation
This file contains hidden or 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 jmeter | |
import com.excilys.ebi.gatling.core.Predef._ | |
import com.excilys.ebi.gatling.http.Predef._ | |
import com.excilys.ebi.gatling.http.Headers.Names._ | |
import bootstrap._ | |
class JMeterBenchmark extends Simulation { | |
def apply = { | |
val httpConf = httpConfig | |
.baseURL("http://localhost:8080/examples/servlets") | |
.acceptCharsetHeader("ISO-8859-1,utf-8;q=0.7,*;q=0.7") | |
.acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") | |
.acceptEncodingHeader("gzip, deflate") | |
.acceptLanguageHeader("fr,fr") | |
.userAgentHeader("Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0.1) Gecko/20100101 Firefox/8.0.1") | |
val scn = scenario("JMeter Benckmark with Gatling") | |
.repeat(30) { | |
exec(http("sessionExample1") | |
.get("/servlet/SessionExample") | |
.check(status.is(200))) | |
.pause(5) | |
.exec(http("sessionExample2Post") | |
.post("/servlet/SessionExample") | |
.param("dataname", "TOTO") | |
.param("datavalue", "TITI") | |
.header(CONTENT_TYPE, "application/x-www-form-urlencoded") | |
.check(status.is(200))) | |
.pause(5) | |
.exec(http("index") | |
.get("/index.html") | |
.check(status.is(200))) | |
.pause(5) | |
.exec(http("sessionExample3") | |
.get("/servlet/SessionExample") | |
.check(status.is(200))) | |
.pause(5) // | |
} | |
List(scn.configure.users(1500).ramp(100).delay(7).protocolConfig(httpConf)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment