How tsenart/vegeta works
Vegeta is an HTTP load-testing tool exposed as both a CLI and a Go library. The main workflow parses targets, runs a rate-controlled attack against HTTP services, and emits encoded results; separate commands transform, summarize, and plot those results. The README also documents Prometheus metrics and multiple target/result formats. Edges are limited to calls visible in excerpts or relationships documented in the README; unsampled implementation details are not inferred.
Main entry points: attack.go Attack command · main.go Vegeta CLI · lib/attack.go Attack engine · encode.go Encode command
Components 21
CLI workflow
- Vegeta CLI
main.go - Attack command
attack.go - Encode command
encode.go - Report command
report.go - Plot command
plot.go
Load generation
- Target input
lib/targets.go - DNS resolver
internal/resolver/resolver.go - Attack engine
lib/attack.go - Rate pacer
lib/pacer.go
Results and reporting
- Attack results
lib/results.go - Metrics aggregation
lib/metrics.go - Result decoder
file.go - Result encoders
lib/results.go - Report generators
lib/reporters.go - Histogram reports
lib/histogram.go - Plot builder
lib/plot/plot.go - Compressed series
lib/plot/timeseries.go - LTTB downsampler
lib/lttb/lttb.go
Export integrations
- Prometheus exporter
lib/prom/prom.go
Other components
- CLI user
- HTTP service
Connections 23
- CLI user → Vegeta CLI: runs commands
README.md - Vegeta CLI → Attack command: runs attack
README.md - Vegeta CLI → Encode command: runs encode
README.md - Vegeta CLI → Report command: runs report
README.md - Vegeta CLI → Plot command: runs plot
README.md - Attack command → Target input: creates targeter
attack.go - Attack command → DNS resolver: configures resolver
attack.go - Attack command → Attack engine: starts attack
attack.go - Attack engine → Rate pacer: paces requests
- Attack engine → HTTP service: sends requests
- Attack engine → Attack results: produces results
- Attack command → Attack results: encodes results
- Attack command → Prometheus exporter: observes results
attack.go - Encode command → Result decoder: decodes input
encode.go - Encode command → Result encoders: encodes output
encode.go - Report command → Result decoder: decodes input
report.go - Report command → Report generators: selects reporter
report.go - Report generators → Histogram reports: uses histogram
- Plot command → Result decoder: decodes input
plot.go - Plot command → Plot builder: adds results
plot.go - Plot builder → Compressed series: adds points
lib/plot/plot.go - Plot builder → LTTB downsampler: downsamples series
lib/plot/plot.go - Prometheus exporter → Attack results: observes metrics
lib/prom/prom.go