A high-performance API load testing tool built in Go, inspired by tools like JMeter and hey. Designed to generate concurrent HTTP traffic, measure latency, and produce actionable performance metrics.
-
Concurrent request execution using worker pools
-
Configurable total requests and concurrency
-
Measures:
- Total requests
- Success vs failure
- Average latency
-
Graceful shutdown using
context.Context -
Modular, maintainable package structure
-
CLI-based usage
go-load-tester/
├── cmd/
│ └── loadtester/
│ └── main.go # Application entry point
├── internal/
│ ├── config/ # Configuration management
│ ├── engine/ # Core load testing engine
│ │ ├── worker.go # Worker pool logic
│ │ ├── dispatcher.go # Job dispatching
│ │ └── runner.go # Test orchestration
│ ├── requester/ # HTTP request handling
│ ├── metrics/ # Thread-safe metrics collection
│ └── report/ # Summary report generation
├── go.mod
└── README.md
This structure follows Go best practices:
- Clear separation of concerns
cmd/for executable entry pointsinternal/to prevent unwanted imports
-
A dispatcher sends jobs into a channel
-
Multiple workers (goroutines) consume jobs concurrently
-
Each worker:
- Sends an HTTP request
- Measures response time
- Records success or failure
-
Metrics are aggregated safely using mutexes
-
A summary report is generated at the end
Make sure you have Go 1.21+ installed.
git clone https://github.com/JagTheFriend/Load-Testing-Tool.git
cd Load-Testing-Tool
go mod tidyRun the load tester from the command line:
go run cmd/loadtester/main.go \
-url https://example.com \
-n 1000 \
-c 50| Flag | Description |
|---|---|
-url |
Target API endpoint (required) |
-n |
Total number of requests |
-c |
Number of concurrent workers |
====== Load Test Report ======
Total Requests: 1000
Successful: 987
Failed: 13
Average Latency:120ms
Test Duration: 3.4s
- Goroutines & channels
- Worker pool pattern
- Thread-safe metrics aggregation
- Context-based cancellation
- Clean package design
- CLI argument parsing
- P95 / P99 latency calculations
- Support for HTTP headers & request bodies
- JSON / CSV report export
- Rate limiting (RPS control)
- Distributed load generation
- Prometheus-compatible metrics output