gatling

📁 g1joshi/agent-skills 📅 3 days ago
1
总安装量
1
周安装量
#52980
全站排名
安装命令
npx skills add https://github.com/g1joshi/agent-skills --skill gatling

Agent 安装分布

mcpjam 1
claude-code 1
replit 1
junie 1
zencoder 1

Skill 文档

Gatling

Gatling is a powerful load testing tool. It is designed for ease of use, maintainability, and high performance. It uses an asynchronous (Akka/Netty) architecture that allows generating huge load from a single machine.

When to Use

  • High Throughput: When you need to simulate 10k+ users from a single laptop.
  • Complex Scenarios: The DSL (Domain Specific Language) allows describing very complex user journeys.
  • JVM Shops: If your team uses Java/Scala/Kotlin.

Quick Start (Java)

import static io.gatling.javaapi.core.CoreDsl.*;
import static io.gatling.javaapi.http.HttpDsl.*;

public class BasicSimulation extends Simulation {

  HttpProtocolBuilder httpProtocol = http
    .baseUrl("http://computer-database.gatling.io")
    .acceptHeader("application/json");

  ScenarioBuilder scn = scenario("BasicSimulation")
    .exec(http("request_1").get("/computers"));

  {
    setUp(
      scn.injectOpen(atOnceUsers(10))
    ).protocols(httpProtocol);
  }
}

Core Concepts

Simulation

The definition of the load test. Contains the HTTP configuration, the Scenario (steps users take), and the Injection Profile (how users arrive).

Feeders

Mechanisms to inject data (valid usernames, search terms) from CSV/JSON into the virtual users so they don’t all look identical.

Best Practices (2025)

Do:

  • Use the Java/Kotlin DSL: Scala was the default, but Java/Kotlin SDKs are now first-class and easier for most teams.
  • Record User Journeys: Use the Gatling Recorder (proxy) to capture browser interactions, then clean up the code.

Don’t:

  • Don’t ignore reports: Gatling generates beautiful HTML reports at the end. Open index.html to see the response time distribution graphs.

References