Skip to content

Instantly share code, notes, and snippets.

@adrianovcar
Last active April 11, 2023 23:16
Show Gist options
  • Save adrianovcar/60ea1de731e58b7305c16c7e252be01a to your computer and use it in GitHub Desktop.
Save adrianovcar/60ea1de731e58b7305c16c7e252be01a to your computer and use it in GitHub Desktop.
Vegeta (Attack) How To Example

Vegeta

Vegeta is a versatile HTTP load testing tool built out of a need to drill HTTP services with a constant request rate. It can be used both as a command line utility and a library.

https://github.com/tsenart/vegeta

Homebrew on Mac OS X

You can install Vegeta using the Homebrew package manager on Mac OS X:

$ brew update && brew install vegeta

Source

You need go installed and GOBIN in your PATH. Once that is done, run the command:

$ go install github.com/tsenart/vegeta@latest

Targets list file

Create a target.list file with the list of endpoint you want to attack, like this:

GET https://apple.com
GET https://google.com

You can send baerer token:

GET https://apple.com
Authorization: Bearer Bearer 80|22yg7oQ4TWlP6DgIFoYclfagdgdi4r1slV0NPvSX

Usage Manual

Usage: vegeta [global flags] <command> [command flags]

This example prints the result of 10 requests for each second, during 5 seconds:

vegeta attack -duration=5s -rate=10 -targets=target.list | tee results.bin | vegeta report
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment