A lightweight, concurrent HTTP benchmarking tool written in Go.
httgo is a Command Line Interface (CLI) tool designed for HTTP load testing. Leveraging Go's native Goroutines and Channels, it spawns concurrent workers to fire requests and processes real-time metrics through a modular Producer-Consumer architecture.
Since this project is written in Go, you can build the binary directly from the source.
- Go 1.25+ installed.
# Clone the repository
git clone https://github.com/rickferrdev/httgo.git
cd httgo
# Build the binary
go build -o httgo cmd/httgo/main.go
# (Optional) Move to your PATH
mv httgo /usr/local/bin/The basic command syntax is:
httgo [flags] <URL>| Flag | Type | Default | Description |
|---|---|---|---|
--concurrency |
int |
5 |
Sets the number of concurrent workers (goroutines) sending requests. |
--method |
string |
get |
Sets the HTTP method to be used (GET, POST, etc.). |
--verbose |
bool |
false |
Enables detailed logging for every request (status, duration, error). |
1. Simple test with default settings: Sends requests using 5 concurrent workers via GET.
./httgo https://example.com2. High concurrency test: Sends requests using 50 simultaneous workers.
./httgo --concurrency 50 https://api.example.com/v1/health3. Test with POST method and verbose mode: Useful for debugging individual request latency or errors.
./httgo --method post --verbose https://api.example.com/submithttgo uses a Producer-Consumer pattern to ensure high performance and avoid race conditions when aggregating metrics.
- Args Parsing: The program starts by parsing user-provided flags.
- Sender (Producer): The
main.goinitializes N goroutines (based on the--concurrencyflag). EachSenderloops through request logic and writes the result (metrics.Metrics) to a shared channel (chan). - Consumer: A single consumer function reads from this channel. It orchestrates a list of
actions(such as logging or calculating averages).- Hooks: Actions have lifecycle hooks:
Before(initialization),Run(per metric), andAfter(summary/cleanup).
- Hooks: Actions have lifecycle hooks:
- Sync: A
sync.WaitGroupensures the program waits for all Senders to complete their tasks before shutting down the Consumer.
To run the project in development mode without compiling a final binary:
go run cmd/httgo/main.go --concurrency 2 --verbose https://google.comThe system is designed to be extensible. To create a new metrics processor (e.g., to save results to a JSON file), implement the Action interface found in internal/actions:
type Action interface {
Before(args *args.Args)
Run(metrics *metrics.Metrics, args *args.Args)
After(metrics *[]metrics.Metrics, args *args.Args)
}Distributed under the MIT License. See LICENSE for more information.