Skip to content

devinterface/gobomber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoBomber - API Load Testing Tool

GoBomber is a powerful and flexible API load testing tool written in Go. It allows you to send millions of requests to your API endpoints and collect detailed performance metrics.

Features

  • Send up to millions of requests to your API endpoints
  • Control concurrency levels
  • Set rate limits for requests
  • Add custom headers and request bodies
  • Get detailed performance metrics
  • Export results to JSON for further analysis

Configuration

GoBomber uses environment variables for configuration. You can set these in a .env file in the project directory:

# API Load Testing Configuration

# Target URLs (comma-separated)
URLS=http://localhost:8080/api/test

# HTTP Method (GET, POST, PUT, DELETE, etc.)
METHOD=GET

# Request Headers (comma-separated key:value pairs)
HEADERS=Content-Type:application/json,Accept:application/json

# Request Body (for POST, PUT methods)
BODY={"test":"data"}
# Alternatively, use BODY_FILE to specify a file path

# Number of requests to send
NUM_REQUESTS=1000000

# Number of concurrent requests
CONCURRENCY=100

# Request timeout in seconds
TIMEOUT=30

# Rate limit in requests per second (0 = no limit)
RATE_LIMIT=0

# Whether to follow redirects (true/false)
FOLLOW_REDIRECT=true

# Output file for detailed results (JSON format)
OUTPUT_FILE=results.json

# Verbose output (true/false)
VERBOSE=false

Usage

  1. Clone this repository
  2. Copy the .env.example file to .env
  3. Configure your .env file with your API endpoints and test parameters
  4. Run the application:
go run main.go

Or build and run:

go build -o gobomber
./gobomber

Example

To test an API endpoint with 1 million requests:

  1. Set up your .env file:
URLS=https://api.example.com/endpoint
METHOD=GET
NUM_REQUESTS=1000000
CONCURRENCY=100
  1. Run the application:
go run main.go

Output

The application will display progress during the test and provide a summary of results when complete:

Progress: 1000000/1000000 (100.00%)
All requests completed!

--- Results ---
Total Requests:      1000000
Successful Requests: 998765 (99.88%)
Failed Requests:     1235 (0.12%)
Total Duration:      1m45s
Requests Per Second: 9523.81
Min Response Time:   15ms
Avg Response Time:   42ms
Max Response Time:   350ms
Total Data Received: 45.32 MB

Status Code Distribution:
  200: 950123 (95.01%)
  201: 48642 (4.86%)
  404: 1235 (0.12%)

Advanced Usage

For more complex scenarios, you can:

  1. Test multiple endpoints by separating URLs with commas
  2. Add request bodies from files using the BODY_FILE variable
  3. Set rate limits to avoid overwhelming your servers
  4. Export detailed results to JSON for further analysis

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages