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

How to send dependent requests #570

Closed maxtar closed 1 year ago

maxtar commented 3 years ago

Hi.

I couldn't understand how I can use response from one request in another one? For example the following scenario:

  1. Do request for authorization.
  2. Get token from answer.
  3. Use this token in the next request.

I couldn't use dynamic targeter in attacker. How I can implement such a scenario?

rgarrigue commented 3 years ago

Hi

I'm looking for the same answer, any luck implenting it ?

flupec commented 2 years ago

@maxtar I'm afraid that there's only one solution -- use vegeta as library and embed it's logic in your own go code

maxtar commented 2 years ago

@flupec

use vegeta as library and embed it's logic in your own go code

The question has occurred to me exactly because I started to write code. :)

flupec commented 2 years ago

@maxtar I guess vegeta not designed for such case. You can try to init three different attackers for each step from scenario above. First attacker will make authorization and return chan of result. This chan of result will be an input for second attacker and so on. In that case you will need different implementation for Targeter function. Try to research by yourself :) But there's no guarantee of performance, it will depend on your implementation of this

tsenart commented 1 year ago

You isn't really designed for this use case, but you can indeed try to hack it by reading results from one attack into the targeter of the next attack.