Generates targets in the Vegeta generated targets json format.
For each image file found a POST request with a mulitpart body consisting of
file: the file contentsname: a randomized string
Usage:
o11y-traffic [flags]
Flags:
-d, --directory string Directory to walk
-f, --forever Run forever (default true)
-h, --help help for imggen
-u, --url string URL to POST form data to (default "http://localhost:8081/api/images")The directory to walk looking for image files identified by file extension :
- .jpeg / .jpg
- .tiff / .tif
- .gif
- .png
- .svg
The sequence of the found files will be randomized before being encoded as targets.
When false the files found will be sent just once. When these files have all been sent the program will exit.
When set to true the files will be continually sent. Each cycle the sequence of the images will be randomized.
The URL where the POST will be made to
Show usage help
You will need to install vegeta.
To find all images under ~/tmp/jpg and send to http://localhost:8080/api/images at a rate of 1 per second for 30 seconds :
o11y-traffic -d ~/tmp/jpg | \
vegeta attack -rate=1/s -lazy -format=json -duration=30s | \
tee results.bin | \
vegeta report