Last active
February 7, 2022 13:30
-
-
Save Integralist/584f6a4cf0a607a9da52 to your computer and use it in GitHub Desktop.
[Vegeta load test examples https://github.com/tsenart/vegeta] #go #golang #vegeta #examples #loadtest #benchmark #report
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "GET http://google.com" | vegeta attack -duration=5s -rate=2 -cert=/path/to/certificate.pem | tee results.bin | vegeta report | |
# you don't have to pipe the data to `vegeta report`, | |
# you can instead run it as a separate command... | |
# | |
# echo "GET http://google.com" | vegeta attack -duration=5s | tee results.bin | |
# vegeta report results.bin | |
# | |
# in the vegeta results you might be confused by the `Status Codes` section: | |
# | |
# e.g. Status Codes [code:count] 0:45 200:5723 500:33 502:13 503:186 | |
# | |
# ...this just means the code (let's use `200 OK` as an example), was received 5723 times. | |
# where as a zero code means there was a problem sending the request. | |
cat results.bin | vegeta report -reporter=plot > plot.html | |
# alternative ploting graph approach... | |
# | |
# vegeta plot -title=Attack%20Results results.bin > results.html | |
# | |
# ...you can also generate the report as JSON... | |
# | |
# vegeta report -type=json results.bin | |
# | |
# to use an external file use `-targets=target.list` where the targets file is... | |
# | |
# GET http://<application_url>/list/user/1 | |
# GET http://<application_url>/list/user/2 | |
# GET http://<application_url>/list/user/3 | |
# | |
# it can also contain POST data... | |
# | |
# POST http://<application_url>/create/newuser/ | |
# Content-Type: application/json | |
# @/path/to/newuser.json | |
# | |
# ...where the file /path/to/newuser.json contains... | |
# | |
# { | |
# "name": "Peter"; | |
# "lastname": "Smith"; | |
# "email": "psmith@example.com" | |
# } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cat results.bin | vegeta report -reporter=plot > plot.html
Above command should change to below command for this version:
cat results.bin | vegeta plot > plot.html