tsenart / vegeta

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

is it possible to generate different data to POST? #221

Closed skygragon closed 7 years ago

skygragon commented 7 years ago

e.g. I need test an POST API with a json body, while there is a "timestamp" field that need to be different for individual request, so is it possible to do this with vegeta?

tsenart commented 7 years ago

Hello @skygragon,

You'll have to write a target generator that feeds into vegeta attack. Prior work on this: https://thisdata.com/blog/load-testing-api-interfaces-with-go-and-vegeta/

skygragon commented 7 years ago

Thanks! will try it.

skygragon commented 7 years ago

Just looked into the demo but seems may not fit my case.

If I understand it correctly, the pokemon will generate some json files in advance thus vegeta could pick them up in attack. However what I'm testing is try to simulate lots of time-series data to openTSDB, which requires each request must have different timestamp values, however I don't know how many requests/jsons should be prepared in the very beginning. Is there a way to let vegeta auto generate different data in the runtime instead of prepared?

tsenart commented 7 years ago

I think it does fit your case. You can create a program in any language that continuously generates new targets and their associated bodies that would be fed into vegeta attack with the -lazy flag set to true. What issues do you see with this approach?