tsenart / vegeta

HTTP load testing tool and library. It's over 9000!
http://godoc.org/github.com/tsenart/vegeta/lib
MIT License
23.51k stars 1.36k forks source link

Feature Request: vegeta should be able to take multiple payloads to attack on same url. #190

Closed achilles42 closed 8 years ago

achilles42 commented 8 years ago

For Example: vegeta attack -targets=targets.txt -body=payload.json -rate=2 -duration=2s

targets.txt:

POST http://localhost:3000/user/profile
Content-Type: application.json

payload.json:

{
   “id": 12,
   "name": “john"
},
{
   “id”:13,
   “name”: “doe" 
},
{
   “id”:14,
   “name”: “alice" 
},
{
   “id”:15,
   “name”: “bob" 
}

So for every attack it should take new payload specified in the payload.json file (payload.json file contains multiple payloads(comma separated))

srajkavithaa commented 5 years ago

Is there any update on this request, this feature will be really helpful. Thanks.

tsenart commented 5 years ago

The way to do this is to simply replicate the same URL for multiple targets with different payloads.

You can easily script this and feed it into stdin of vegeta attack. It's easier to do it with the JSON targets format.

If you want to generate targets on the go, use the -lazy flag.

jkxdev commented 4 years ago

this wont be of much help. what if I need each request to pickup different payloads. ?

tsenart commented 4 years ago

what if I need each request to pickup different payloads. ?

The you generate a different body for each target you produce as input.

jkxdev commented 4 years ago

I think i got it. sorry for the confusion.. i was thinking one attack means one api and one payload ran for n number of times