gatling
Gatling is a highly capable load testing tool. It is designed for ease of use, maintainability and high performance.
ガトリングは優秀な負荷テストツールです。これは、使いやすさ、保守性の高いパフォーマンスを実現するように設計されている。(google翻訳)
gatling-sbt
gatling-sbtはsbt test
でgatlingを実行出来るようにするためのものです。(合ってる?)
使い方
まずはREADMEに記載の中で一番ラクな方法をとれる
or for 0.13.6 and later :
のものを使用します。
build.properties
sbt.version = 0.13.7
build.sbt
name := "GatlingerGirl"
version := "1.0"
scalaVersion := "2.11.5"
libraryDependencies ++= Seq(
"io.gatling.highcharts" % "gatling-charts-highcharts" % "2.1.4",
"io.gatling.highcharts" % "gatling-charts-highcharts" % "2.1.3" % "test",
"io.gatling" % "gatling-test-framework" % "2.1.3" % "test"
)
enablePlugins(GatlingPlugin)
plugin.sbt
logLevel := Level.Warn
addSbtPlugin("io.gatling" % "gatling-sbt" % "2.1.0")
コード
src/test/scala 配下に作ります。
超絶シンプルに書きました。
Main.scala
/**
* Created by FScoward on 2015/02/02.
*/
import io.gatling.core.Predef._
import io.gatling.http.Predef._
class Main extends Simulation {
val req = http("github").get("https://github.com/gatling/gatling").check(status.is(200))
val scn = scenario("request").exec(req)
setUp(scn.inject(atOnceUsers(1)))
}
実行
sbt test
で実行すればいい感じに結果が出力されます。