LoginSignup
34
30

More than 5 years have passed since last update.

gatlingの使い方

Last updated at Posted at 2015-02-02

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 で実行すればいい感じに結果が出力されます。

github

34
30
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
34
30