Load Test an API Endpoint with a Different Request Body Each Iteration
I'd like to execute a load test again a specific API endpoint POST my.api.com/graphql. This API endpoint takes a request body that looks like this:
{
"clientMutationId": (string)
"messageId": (string)
...
}
Each iteration that each concurrent worker executes I'd like the request body to have a new messageId field. What would be the best way to achieve that dynamic target? I haven't seen any examples of this in any of the doc and I'm having a hard time figuring out what might be the best approach for that.
Is this related to your question? : https://github.com/tsenart/vegeta/issues/330
As long as that message id doesn't depend on a response from a previous request, then you can write a program or script that produces targets with those bodies (each with a different message ID) and feed it to vegeta attack with the -lazy flag on. I suggest you use the json target format.