Skip to main content
appkiro.com

Gatling負荷テストスクリプト生成

injection profile、scenario、HTTP/WebSocket request、check、feeder、protocol option からレビュー可能な Gatling Scala Simulation の出発ファイルを生成します。

What is this tool?
A visual builder for a Gatling Scala starter simulation that still requires review in the destination project.

Gatling is an open-source load testing tool that simulates many users hitting your API or website at the same time, then reports response times, throughput, and errors. This generator turns the form below into a reviewable Simulation.scala starter file: configure the target URL, how users arrive, the requests they make, and the pass/fail checks, then download, review, compile, and run only against an authorized target.

Who it's for

Backend / SRE / QA engineers who need real load numbers without writing Scala from scratch. Beginners and Gatling pros alike.

出力内容

A starter Simulation.scala with HTTP protocol, scenarios, requests, checks, and an injection profile. Edit further if needed.

Privacy

Generation occurs in this browser tab. Do not paste live credentials, and review browser/site telemetry policy first.

1. Users (injection)
How virtual users will be injected over time.
2. Scenarios (flows)
Each scenario wraps every HTTP request below in its own loop.
1
2
3
3. HTTP リクエスト
Each row becomes one exec(http(...)) call inside every scenario. Reorder, duplicate, or load a template.
1
2
3
4
5
4. チェック(アサーション)
Validate responses on every request.
5. Data feeder (optional)
Inject parameterized data from a CSV/JSON file.
Enable
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._

class GeneratedSimulation extends Simulation {

  val httpProtocol = http
    .baseUrl("https://example.com")
    .acceptHeader("application/json")
    .contentTypeHeader("application/json")

  val scn1 = scenario("User Journey")
    .repeat(1) {
      exec(http("Home Page")
        .get("/")
        .requestTimeout(10.seconds)
        .check(status.is(200))
        .check(responseTimeInMillis.lt(500))
        .check(substring("success"))
      )
      .pause(1)
      exec(http("Login")
        .post("/api/auth/login")
        .requestTimeout(10.seconds)
        .body(StringBody("""{\"username\":\"${username}\",\"password\":\"${password}\"}"""))
        .check(status.is(200))
        .check(responseTimeInMillis.lt(500))
        .check(substring("success"))
      )
      .pause(1)
      exec(http("Get Products")
        .get("/api/products")
        .requestTimeout(10.seconds)
        .check(status.is(200))
        .check(responseTimeInMillis.lt(500))
        .check(substring("success"))
      )
      .pause(1)
      exec(http("Product Detail")
        .get("/api/products/${id}")
        .requestTimeout(10.seconds)
        .check(status.is(200))
        .check(responseTimeInMillis.lt(500))
        .check(substring("success"))
      )
      .pause(1)
      exec(http("Add To Cart")
        .post("/api/cart")
        .requestTimeout(10.seconds)
        .body(StringBody("""{\"productId\":\"${id}\",\"qty\":1}"""))
        .check(status.is(200))
        .check(responseTimeInMillis.lt(500))
        .check(substring("success"))
      )
    }

  val scn2 = scenario("Browse Products")
    .repeat(2) {
      exec(http("Home Page")
        .get("/")
        .requestTimeout(10.seconds)
        .check(status.is(200))
        .check(responseTimeInMillis.lt(500))
        .check(substring("success"))
      )
      .pause(1)
      exec(http("Login")
        .post("/api/auth/login")
        .requestTimeout(10.seconds)
        .body(StringBody("""{\"username\":\"${username}\",\"password\":\"${password}\"}"""))
        .check(status.is(200))
        .check(responseTimeInMillis.lt(500))
        .check(substring("success"))
      )
      .pause(1)
      exec(http("Get Products")
        .get("/api/products")
        .requestTimeout(10.seconds)
        .check(status.is(200))
        .check(responseTimeInMillis.lt(500))
        .check(substring("success"))
      )
      .pause(1)
      exec(http("Product Detail")
        .get("/api/products/${id}")
        .requestTimeout(10.seconds)
        .check(status.is(200))
        .check(responseTimeInMillis.lt(500))
        .check(substring("success"))
      )
      .pause(1)
      exec(http("Add To Cart")
        .post("/api/cart")
        .requestTimeout(10.seconds)
        .body(StringBody("""{\"productId\":\"${id}\",\"qty\":1}"""))
        .check(status.is(200))
        .check(responseTimeInMillis.lt(500))
        .check(substring("success"))
      )
    }

  val scn3 = scenario("Checkout Flow")
    .repeat(1) {
      exec(http("Home Page")
        .get("/")
        .requestTimeout(10.seconds)
        .check(status.is(200))
        .check(responseTimeInMillis.lt(500))
        .check(substring("success"))
      )
      .pause(1)
      exec(http("Login")
        .post("/api/auth/login")
        .requestTimeout(10.seconds)
        .body(StringBody("""{\"username\":\"${username}\",\"password\":\"${password}\"}"""))
        .check(status.is(200))
        .check(responseTimeInMillis.lt(500))
        .check(substring("success"))
      )
      .pause(1)
      exec(http("Get Products")
        .get("/api/products")
        .requestTimeout(10.seconds)
        .check(status.is(200))
        .check(responseTimeInMillis.lt(500))
        .check(substring("success"))
      )
      .pause(1)
      exec(http("Product Detail")
        .get("/api/products/${id}")
        .requestTimeout(10.seconds)
        .check(status.is(200))
        .check(responseTimeInMillis.lt(500))
        .check(substring("success"))
      )
      .pause(1)
      exec(http("Add To Cart")
        .post("/api/cart")
        .requestTimeout(10.seconds)
        .body(StringBody("""{\"productId\":\"${id}\",\"qty\":1}"""))
        .check(status.is(200))
        .check(responseTimeInMillis.lt(500))
        .check(substring("success"))
      )
    }

  setUp(
    scn1.inject(
      rampUsers(100).during(10.minutes),
      constantUsersPerSec(100).during(20.minutes),
      rampUsers(100).during(5.minutes)
    ),
    scn2.inject(
      rampUsers(100).during(10.minutes),
      constantUsersPerSec(100).during(20.minutes),
      rampUsers(100).during(5.minutes)
    ),
    scn3.inject(
      rampUsers(100).during(10.minutes),
      constantUsersPerSec(100).during(20.minutes),
      rampUsers(100).during(5.minutes)
    )
  ).protocols(httpProtocol)
}
出力内容
Complete Gatling Simulation.scala
Project structure ready
Run instructions for your OS
HTML report after the test run

Gatling負荷テストスクリプト生成とは何ですか?

injection profile、scenario、HTTP/WebSocket request、check、feeder、protocol option からレビュー可能な Gatling Scala Simulation の出発ファイルを生成します。 Base URL/protocol、user injection と ramp/hold/down、scenario、request、check、CSV feeder、repeat/during、任意の WebSocket 設定。 設定した injection、scenario、protocol、request、check、feeder を含む、保存可能な Scala Simulation.scala の出発ファイル。

ツールを開く

このツールでできること

  • 入力: Base URL/protocol、user injection と ramp/hold/down、scenario、request、check、CSV feeder、repeat/during、任意の WebSocket 設定。
  • 設定と処理: injection users/ramp/hold/down、repeat/during scenario、HTTP request builder、check、CSV feeder、protocol/WebSocket option、preview、download。
  • 出力: 設定した injection、scenario、protocol、request、check、feeder を含む、保存可能な Scala Simulation.scala の出発ファイル。

使い方

  1. 入力を追加する。 Base URL/protocol、user injection と ramp/hold/down、scenario、request、check、CSV feeder、repeat/during、任意の WebSocket 設定。
  2. 設定を確認する。 injection users/ramp/hold/down、repeat/during scenario、HTTP request builder、check、CSV feeder、protocol/WebSocket option、preview、download。
  3. 生成・確認・書き出しを行う。 設定した injection、scenario、protocol、request、check、feeder を含む、保存可能な Scala Simulation.scala の出発ファイル。

主な機能

  • 入力: Base URL/protocol、user injection と ramp/hold/down、scenario、request、check、CSV feeder、repeat/during、任意の WebSocket 設定。
  • 設定と処理: injection users/ramp/hold/down、repeat/during scenario、HTTP request builder、check、CSV feeder、protocol/WebSocket option、preview、download。
  • 出力: 設定した injection、scenario、protocol、request、check、feeder を含む、保存可能な Scala Simulation.scala の出発ファイル。

活用シーン

  • injection profile、scenario、HTTP/WebSocket request、check、feeder、protocol option からレビュー可能な Gatling Scala Simulation の出発ファイルを生成します。
  • 次の出力・診断結果が必要な場面で使います:設定した injection、scenario、protocol、request、check、feeder を含む、保存可能な Scala Simulation.scala の出発ファイル。
  • 次の確認済み工程の前に配置します:対象 Gatling project でコンパイルし、許可された smoke test、監視下で段階的 ramp-up。

制限と安全上の注意

  • Gatling を実行せず、コンパイルも保証しません。 Scala DSL とプロジェクト構成は Gatling version・build tool で変わるため、dependency、import、feeder、session 変数、check、TLS、認証、対象許可を確認してください。

トラブルシューティング

  • 許可済みの1リクエストと最小 scenario から始め、実プロジェクトで対象ツールの version、構文、import/dependency、データ参照を確認してください。
  • 認証情報を環境変数または secret management に移し、生成ファイルを compile/lint してから ramp-up 前に低負荷の smoke test を実行してください。
  • Gatling を実行せず、コンパイルも保証しません。 Scala DSL とプロジェクト構成は Gatling version・build tool で変わるため、dependency、import、feeder、session 変数、check、TLS、認証、対象許可を確認してください。

よくある質問

Gatling負荷テストスクリプト生成とは何ですか?

injection profile、scenario、HTTP/WebSocket request、check、feeder、protocol option からレビュー可能な Gatling Scala Simulation の出発ファイルを生成します。

Gatling負荷テストスクリプト生成はどう使いますか?

想定された入力を追加し、ページ設定を確認してから、コピーまたはダウンロード前に結果を検証します。 想定出力:設定した injection、scenario、protocol、request、check、feeder を含む、保存可能な Scala Simulation.scala の出発ファイル。

どの入力に対応していますか?

Base URL/protocol、user injection と ramp/hold/down、scenario、request、check、CSV feeder、repeat/during、任意の WebSocket 設定。

どのような出力を生成しますか?

設定した injection、scenario、protocol、request、check、feeder を含む、保存可能な Scala Simulation.scala の出発ファイル。

どのような制限がありますか?

Gatling を実行せず、コンパイルも保証しません。 Scala DSL とプロジェクト構成は Gatling version・build tool で変わるため、dependency、import、feeder、session 変数、check、TLS、認証、対象許可を確認してください。

関連する AppKiro ツール

確認済みのサンプルから始める

最小スクリプトを生成して対象プロジェクトで確認し、制御された ramp-up 前は許可済みの非本番環境だけで実行してください。

ツールを開く