Performance Testing & Gatling Load Testing
Welcome to a comprehensive, hands-on guide to performance testing and the Gatling load testing framework. This documentation covers everything from foundational concepts to production-grade testing strategies.
🎯 What You'll Learn
For Beginners
- What is performance testing? Why does it matter for your systems?
- Key metrics: p95, p99, latency, throughput, and what they mean
- Load testing methodology: How to properly design and execute tests
- Gatling basics: From your first HTTP request to Kafka event streams
For Practitioners
- Advanced load patterns: Constant, ramp, step, and spike testing strategies
- Scenario design: Building realistic user journeys with feeders and data correlation
- Production monitoring: Datadog integration, trace analysis, and bottleneck identification
- Optimization: Custom feeders, distributed testing, and performance tuning
📚 Learning Paths
Path 1: Rapid Start (2-3 hours)
1. What is Performance Testing? (15 min)
↓
2. Key Metrics Explained (20 min)
↓
3. Lab 1: Basic HTTP (20 min)
↓
4. Lab 2: HTTP Feeders (20 min)
↓
5. Lab 3: Validation (20 min)
↓
6. Lab 4: Load Profiles (30 min)
Outcome: Understand core Gatling concepts and run your first simulations.
Path 2: Complete Mastery (6-8 hours)
Foundations (2 hours)
├── What is Performance Testing?
├── Key Metrics & Measurements
├── Load Testing Methodology
├── Open Load Patterns
├── Performance Targets & SLAs
└── Common Pitfalls
Gatling Concepts (1.5 hours)
├── Gatling Architecture
├── Simulation Lifecycle
├── HTTP vs Kafka Patterns
├── Scenarios & Feeders
├── Checks & Assertions
└── Session & Correlation
Practical Labs (2.5 hours)
├── Lab 1-5: HTTP & CRUD operations
├── Lab 6-7: Kafka producer & feeders
└── Lab 8: Advanced patterns
Monitoring (1-2 hours)
├── Datadog Integration
├── Traces & Operations
├── Dashboard Queries
└── Load Test Analysis
Outcome: Deep expertise in performance testing, Gatling patterns, and production monitoring.
Path 3: Enterprise Setup (Custom)
For teams deploying load testing in production:
├── Distributed Testing Architecture
├── CI/CD Integration
├── Custom Feeders for Business Logic
├── Advanced Performance Optimization
└── Multi-service Load Test Coordination
🚀 Quick Start
1. Prerequisites
# Check Java and Maven versions
java -version # Java 21+
mvn -version # Maven 3.9+
docker -v # For Kafka labs (optional)
2. Clone & Navigate
3. Run Your First Simulation
# HTTP simulation (no Docker needed)
mvn gatling:test -Dgatling.simulationClass=io.learn.gatling.simulations.http.Sim01_BasicHttp
# View the report
open target/gatling/*/index.html
4. Build the Documentation
📖 Documentation Structure
Foundations (1-2 hours)
Understand the "why" and "what" of performance testing before writing code.
- What is Performance Testing? — Types, why it matters
- Key Metrics & Measurements — Latency, throughput, resources
- Load Testing Methodology — Best practices, workflow
- Open Load Patterns — Constant, ramp, step, spike
- Performance Targets & SLAs — Industry benchmarks
- Common Pitfalls — What to avoid
Gatling Concepts (1.5-2 hours)
Learn how Gatling works under the hood.
- Gatling Architecture — Core components
- Simulation Lifecycle — Execution flow
- HTTP vs Kafka Patterns — When to use each
- Scenarios & Feeders — Data injection
- Checks & Assertions — Validation
- Session & Correlation — State management
Practical Labs (3-4 hours)
Build real skills with 8 hands-on labs, progressing from basics to advanced patterns.
- Lab Overview — How to work through labs
- Lab 1: Basic HTTP — GET requests, pauses, constant load
- Lab 2: HTTP Feeders — CSV/JSON data injection
- Lab 3: Checks & Validation — Response validation, correlation
- Lab 4: Load Profiles — Smoke, ramp, step, spike tests
- Lab 5: CRUD Operations — PUT, PATCH, DELETE
- Lab 6: Kafka Producer — Event streaming basics
- Lab 7: Kafka with Feeders — Data-driven Kafka tests
- Lab 8: Advanced Patterns — Async, throttling, complex scenarios
Monitoring & Analysis (1-2 hours)
Understand how to monitor and analyze load tests with Datadog.
- Datadog Integration — APM setup, tags
- Traces, Operations & Spans — Understanding traces
- Dashboard Queries — Writing queries
- Load Test Analysis — Reading results
Advanced Topics (Optional)
For production deployments and complex scenarios.
- Custom Feeders — Building data generators
- Advanced Patterns — Complex scenarios
- Optimization Tips — JVM tuning, performance
- Distributed Testing — Multi-machine setups
Reference (Lookup)
Quick reference guides and troubleshooting.
- Quick Reference — Cheat sheet, common patterns
- Glossary — Terminology explained
- Run Commands — All Maven commands
- FAQ & Troubleshooting — Solving common issues
🎓 How to Use This Guide
For Self-Paced Learning
- Start with Foundations — read top-to-bottom
- Move to Gatling Concepts — understand the framework
- Work through Labs 1-8 in order, running each simulation
- Explore Monitoring & Analysis as you scale tests
- Reference Advanced Topics and Reference as needed
For Structured Training
- Session 1 (2h): Foundations + Gatling Architecture
- Session 2 (1.5h): Labs 1-4 (HTTP)
- Session 3 (1.5h): Labs 5-7 (CRUD, Kafka)
- Session 4 (1h): Monitoring, Lab 8, Q&A
For Teams
- Share the Quick Reference as a team cheat sheet
- Use Run Commands for CI/CD setup
- Reference Glossary for terminology alignment
- Build custom labs based on Advanced Patterns
🛠️ Project Structure
This documentation guides you through the GatlingLearning project:
GatlingLearning/
├── src/test/java/io/learn/gatling/simulations/
│ ├── http/
│ │ ├── Sim01_BasicHttp.java ..................... Lab 1
│ │ ├── Sim02_HttpWithFeeders.java .............. Lab 2
│ │ ├── Sim03_HttpChecks.java ................... Lab 3
│ │ ├── Sim04_LoadProfiles.java ................. Lab 4
│ │ └── Sim05_CRUD.java ......................... Lab 5
│ └── kafka/
│ ├── Sim06_BasicKafkaProducer.java .......... Lab 6
│ └── Sim07_KafkaWithFeeders.java ............ Lab 7
├── src/test/resources/
│ ├── data/
│ │ ├── users.csv, products.csv, stores.csv
│ │ └── posts.json
│ └── bodies/
│ ├── update_post.json, product_event.json
│ └── inventory_event.json
└── docs/ ........................................ This documentation
📊 What You'll Achieve
By completing this learning path, you'll be able to:
✅ Design realistic load test scenarios for HTTP and Kafka
✅ Understand key metrics and what they mean for your system
✅ Run simulations with constant, ramp, step, and spike load patterns
✅ Validate responses and extract data for correlation
✅ Monitor tests with Datadog and identify bottlenecks
✅ Optimize system performance based on load test results
✅ Build custom feeders and advanced patterns
✅ Deploy load tests in production with CI/CD integration
💡 Key Concepts Preview
Performance Testing Types
- Load Testing: Measure performance under expected load
- Stress Testing: Find the breaking point
- Soak Testing: Check long-term stability
- Spike Testing: Validate recovery from sudden spikes
Load Patterns You'll Master
- Constant Load: Steady traffic (baseline testing)
- Ramp Load: Gradual increase to find limits
- Step Load: Staircase increases for threshold analysis
- Spike Load: Sudden burst for resilience testing
Gatling Patterns You'll Use
- HTTP Simulations: Request-response testing
- Kafka Simulations: Event-driven testing
- Feeders: Data injection for realistic scenarios
- Checks: Response validation and correlation
- Assertions: SLA pass/fail criteria
🤝 Contributing & Feedback
This documentation is a living guide. As you work through labs:
- Found an issue? Note it in FAQ & Troubleshooting
- Have a tip? Suggest additions to Quick Reference
- Want to improve? Every section has a "Further Reading" link
📖 Additional Resources
Official Documentation
Related Technologies
Community
🎯 Next Steps
- Start here: What is Performance Testing?
- Then read: Key Metrics & Measurements
- Build first skill: Lab 1: Basic HTTP
- Progress systematically through all labs
Happy learning! 🚀