Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
vegeta
✓ github.com/tsenart/vegeta/v12
Runs a load test against a target URL and prints the 99th percentile latency.
package main
import (
"fmt"
"time"
"github.com/tsenart/vegeta/v12"
)
func main() {
rate := vegeta.Rate{Freq: 100, Per: time.Second}
duration := 4 * time.Second
targeter := vegeta.NewStaticTargeter(vegeta.Target{
Method: "GET",
URL: "http://localhost:8080",
})
attacker := vegeta.NewAttacker()
var metrics vegeta.Metrics
for res := range attacker.Attack(targeter, rate, duration, "Big Bang!") {
metrics.Add(res)
}
metrics.Close()
fmt.Printf("99th percentile: %s\n", metrics.Latencies.P99)
}
Upgrade
Version history
12.13.0latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.