????Gatling???????????????????????Scala?? Akka and Netty??
???????????????????????????д?????????б????????????????
???????????????????????????????csv??json??jdbc??redis??????????????
??????????????????????
?????????????????????????
????????????
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
class RecordedSimulation extends Simulation {
val httpProtocol = http
.baseURL("http://192.168.1.117/")
.acceptHeader("""*/*""")
.acceptEncodingHeader("""gzip?? deflate""")
.acceptLanguageHeader("""zh-CN""")
.userAgentHeader("""Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)""")
val headers_2 = Map("""Accept""" -> """text/html?? application/xhtml+xml?? */*""")
val scn = scenario("RecordedSimulation")
.repeat(1){
//.forever{
feed(csv("large_files.csv").circular)
.exec(http("request_"+"${id}")
.get("${uri}")
.headers(headers_2)
//.check(status.is(200)))
.check(status.in(200 to 399)))
.pause(1)
}
setUp(
scn.inject(atOnceUsers(1000))
)
.protocols(httpProtocol)
}
large_files.csv??????user-files/data/????
????????????
????id??uri
????1??index.html
????2??download/file.zip