$ show tsenart/vegeta
Vegeta is a versatile HTTP load testing tool and Go library. It simulates constant-rate or oscillating traffic against HTTP endpoints, collects latency and byte metrics, and generates reports (text, JSON, histograms, HTML plots). The core is an attack engine with pluggable pacers, a targeter for reading HTTP request specs, and a metrics pipeline using t-digest for percentile estimates. It includes a Prometheus exporter and a downsampling library for plotting large time series. The codebase is well-structured with clean package boundaries, cross-platform support, and extensive testing including fuzzing.
The LLM identified 4 files worth highlighting for reuse:
Defines a Pacer interface with implementations for constant, sine-wave, and linear ramp-up request rates. Each pacer computes the delay between requests, making it a self-contained, reusable component for any rate-controlled workload generator or traffic shaping system.
Streaming implementation of the Largest-Triangle-Three-Buckets (LTTB) downsampling algorithm. It accepts an iterator callback that returns batches of points, enabling memory-efficient reduction of large time series while preserving visual shape. Fully self-contained and independently useful for any charting or visualization pipeline.
Metrics struct that aggregates latency, bytes, and success counts using a t-digest estimator for accurate percentiles. Provides a clean, reusable way to compute statistical summaries from streams of measurements, applicable beyond load testing.
Plugabble reporter interface with text, JSON, and histogram outputs. Each reporter consumes a metric results stream and emits a specific format. The interface is small and well-isolated, making it easy to add new formats or reuse existing ones in other monitoring tools.