Performance Testing & Gatling Engineering¶
Welcome to a modern, end-to-end guide to Performance Engineering Theory and hands-on Load Testing with Gatling. Move systematically from mathematical scalability laws and workload modeling to HTTP & Kafka simulations, APM trace correlation, and automated CI/CD regression gates.
-
Performance Engineering Theory
Master Little's Law, M/M/1 queuing curves, Universal Scalability Law, Open vs. Closed models, Coordinated Omission, Apdex, and SLI/SLO/Error Budgets.
-
Gatling Engine & Java DSL
Understand Gatling's non-blocking Netty event-loop architecture, virtual user state machines, feeders, response checks, correlation, and distributed clusters.
-
8 Self-Contained Labs
Run real Java 21 simulations against public HTTP endpoints and an embedded Testcontainers Kafka broker—zero cloud credentials or external accounts needed.
-
Interactive Mastery Quiz
Validate your understanding with interactive single-choice, multi-select, and fill-in-the-blank quizzes embedded across chapters and in the final assessment.
Learning Roadmap¶
flowchart LR
T1["1. Foundations & Laws<br/>Metrics • Little's Law • USL<br/>Coordinated Omission"] --> T2["2. Strategy & Architecture<br/>Methodology • Load Shapes<br/>SLOs • Bottlenecks & Capacity"]
T2 --> T3["3. Gatling Core DSL<br/>Event Loop • Feeders<br/>Checks • Session Correlation"]
T3 --> T4["4. Hands-On Labs 1–8<br/>HTTP • CRUD • Load Profiles<br/>Embedded Kafka Streaming"]
T4 --> T5["5. Observability & CI<br/>Datadog APM Traces<br/>Shift-Left Gates & Quiz"]
- What is Performance Testing? — Taxonomy of 10 test types & Shift-Left/Right
- Key Metrics & Frameworks — Percentiles, HDR Histograms, Apdex, RED/USE/Golden Signals
- Mathematical Laws & Queuing — Little's Law & why latency explodes at 80% utilization
- Workload Models & Coordinated Omission — Open vs. Closed models
- Labs 1–4: HTTP Track — Run your first Gatling simulations & read HTML reports
- Complete Foundations & Laws (
01–04) + Methodology & Architecture (05–09) - Master Gatling Framework internals, immutable
Sessioncorrelation, custom feeders & JVM tuning - Execute all 8 HTTP & Kafka Labs locally with Maven & Docker
- Correlate client metrics with server Datadog APM Traces & Spans
- Score 90%+ on the Performance Engineering Mastery Quiz
- SLIs, SLOs, SLAs & Error Budgets — Composite microservice availability & latency budgets
- Bottlenecks, Resilience & Capacity Planning — HikariCP sizing, Cache Stampedes, Load Shedding, Fleet sizing
- Common Pitfalls & Shift-Left CI — Automated CI build-breaking SLO gates
- Distributed Testing — Scaling load generation across multi-node clusters
Quick Start¶
1. Prerequisites¶
| Tool | Version | Purpose |
|---|---|---|
| Java (JDK) | 21+ |
Compiling & running Gatling simulations (java -version) |
| Maven | 3.9+ |
Executing gatling-maven-plugin (mvn -version) |
| Docker | Recent | Required only for embedded Testcontainers Kafka Labs 6–7 (docker info) |
| uv (or Python 3.12+) | Recent | Serving & building this MkDocs documentation site (uv --version) |
2. Run Your First Gatling Simulation¶
git clone https://github.com/nitinkc/GatlingLearning.git
cd GatlingLearning
# Run Lesson 1 (HTTP against JSONPlaceholder — no Docker needed)
mvn gatling:test -Dgatling.simulationClass=io.learn.gatling.simulations.http.Sim01_BasicHttp
# Open the generated interactive HTML report (macOS)
open target/gatling/*/index.html
3. Serve Documentation Locally¶
Curriculum Directory¶
Performance Theory¶
- 01. What is Performance Testing? — Load, Stress, Soak, Spike, Scalability, Volume, Breakpoint & Shift-Left/Right
- 02. Key Metrics & Frameworks — Latency anatomy, Percentiles, Histograms, Apdex, Four Golden Signals, RED & USE
- 03. Mathematical Laws & Queuing — Little's Law, M/M/1 Knee, Kingman's Formula, Amdahl's Law, USL & Tail at Scale
- 04. Workload Models & Coordinated Omission — Open vs. Closed loops, Pacing vs. Think Time, Markov Funnels & Gil Tene's Coordinated Omission
- 05. Load Testing Methodology — 8-phase scientific testing lifecycle & pre-flight checklists
- 06. Load Injection Patterns — Constant, Ramp, Step Meta-DSL, Spike + Recovery & Closed concurrency
- 07. SLIs, SLOs, SLAs & Error Budgets — Error budget math, composite availability & microservice latency budgets
- 08. Bottlenecks & Capacity Planning — CPU/GC/DB/TCP diagnostics, Cache Stampedes, Resilience & Fleet sizing
- 09. Common Pitfalls & Shift-Left CI — Top 10 measurement traps & GitHub Actions regression gates
Gatling Framework & Observability¶
- Gatling Architecture · Simulation Lifecycle · HTTP vs Kafka Patterns
- Scenarios & Feeders · Checks & Assertions · Session & Correlation
- Datadog Integration · Traces, Operations & Spans · Dashboard Queries · Load Test Analysis
- Custom Feeders · Advanced Patterns · Optimization & JVM Tuning · Distributed Testing