Closed vishnuchalla closed 11 months ago
The Pacers are public in the Go module so you could use them, wrap them with your own custom logic or even write your own.
But the easiest thing for you to do is to set the duration of your attack to 1s while keeping the attack rate at 1000 per second.
Try that and let me know if it solved your problem.
No I am looking to send 1000 requests in total with 50 rps and stop immediately once I am done sending 1000 requests. With the above suggestion, I don't think it would be possible. Also I think I have achieved it with this PR.
If you want to send 1000 request at 50 req/s, then your duration should be 20s (1000/50)
If you want to send 1000 request at 50 req/s, then your duration should be 20s (1000/50)
Thanks for the suggestion. I did add a dynamic logic to calculate/adjust duration according to my input requests and rps.
Question
We have this implementation of vegeta in our code using go-client. We want to make 1000 requests with 50 rps and stop the attack immediately as soon as it finishes those 1000 requests. By the time we call
attacker.Stop()
in our code [reference] it doesn't seem to be immediately stopping the attack and goes way over 1000 requests (i.e almost 3-4 times) before the attack actually stops which is very frustrating.Example instance:
Detailed logs for vegeta go-client implementation: go_client_vegeta_logs.txt
But if we try to achieve the same functionality through CLI implementation, it works like a charm. Looks like CLI implementation has an immediate way to stop the attack without calling
attacker.Stop()
by just verifying the count of requests using Pacer which is not exposed through go-client.Example instance:
Detailed logs for vegeta CLI implementation: cli_version_vegeta_logs.txt
Is there a hacky/suggested way to implement my GO code in such a way that it immediately stops the attack after 1000 requests similar to what is happening in the CLI version as of today?