Skip to content

lasitosPT/volley

Repository files navigation

volley

A fast, concurrent HTTP load tester in a single Go binary — zero dependencies.

CI Go Report Card Go License: MIT

volley fires a burst of concurrent HTTP requests at an endpoint and reports throughput and latency percentiles. It uses a worker-pool of goroutines, reuses connections, and stops cleanly on Ctrl-C.

$ volley -n 30 -c 6 https://example.com
Sending 30 requests to https://example.com (concurrency 6)...
Requests   : 30 (30 ok, 0 failed, 0 errored)
Duration   : 81ms
Throughput : 371.5 req/s
Latency    :
  min 7.972ms  mean 15.453ms  max 44.299ms
  p50 8.739ms  p90 43.407ms  p95 44.248ms  p99 44.299ms
Status codes:
  200 : 30

Install

go install github.com/lasitosPT/volley/cmd/volley@latest

Or build from source:

git clone https://github.com/lasitosPT/volley && cd volley
go build -o volley ./cmd/volley

Usage

volley -n 1000 -c 50 https://example.com     # 1000 requests, 50 workers
volley -d 30s  -c 20 https://example.com     # run for 30 seconds
volley -X POST -H 'Content-Type: application/json' -b '{"ping":true}' https://api.example.com

Options

Flag Description Default
-n Total number of requests (0 = use -d) 100
-d Run for a duration instead of a fixed count
-c Number of concurrent workers 10
-t Per-request timeout 10s
-X HTTP method GET
-H Request header 'Name: Value' (repeatable)
-b Request body
--version Print version and exit

How it works

  • Worker pool-c goroutines pull work until the request count is exhausted (or the duration elapses), so concurrency stays constant without spawning a goroutine per request.
  • Connection reuse — a shared http.Client with a tuned transport keeps keep-alive connections warm under load.
  • Latency percentiles — results are collected and reduced to min / mean / max and p50–p99 (nearest-rank).
  • Graceful cancellationcontext cancellation wired to SIGINT stops in-flight work and still prints a summary.

Library

volley is also importable:

import "github.com/lasitosPT/volley"

summary, err := volley.Run(ctx, volley.Options{
    URL:         "https://example.com",
    Requests:    1000,
    Concurrency: 50,
    Timeout:     10 * time.Second,
})
fmt.Print(volley.FormatSummary(summary))

License

MIT © Pedro Lascasas Pinto

About

A fast, concurrent HTTP load tester in a single Go binary — zero dependencies.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages