autocannon icon indicating copy to clipboard operation
autocannon copied to clipboard

Request delay

Open AndreaFranchini opened this issue 6 years ago • 5 comments

Example:

{
  connection: 1,
  connectionRate: 1,
  duration: 2,
}

Autocannon will perform 1 req/sec for 2 seconds.

{
  connection: 1,
  connectionRate: 2,
  duration: 2,
}

Autocannon will perform 2 req/sec for 2 seconds. But the requests are fired during the very firsts milliseconds.

How can i setup autocannon for fire request every x milliseconds?

AndreaFranchini avatar Oct 25 '18 13:10 AndreaFranchini

I don't understand. Autocannon waits for the previous request to finish before starting the new one.

mcollina avatar Oct 25 '18 13:10 mcollina

Using other words: can i fire request with an omogeneous/costant distribution? I want to setup a scenario where the request are sended at same rate during the test duration.

If i set 50 request per second and i draw a graph of number of request over time, i get an "heartbeat": 50 request in 100ms then 900ms of nothing, repeated during time. What I would like is a graph that is ideally an horizontal straight line, one request every 20ms.

Provided that this type of load test makes sense...

AndreaFranchini avatar Oct 25 '18 14:10 AndreaFranchini

Autocannon currently does not support that feature, but feel free to send a PR if you would like to work on it!

mcollina avatar Oct 25 '18 14:10 mcollina

Is it still something we want to implement ? I'd be glad to work on it

lvndry avatar Jul 08 '21 11:07 lvndry

Go for it!

mcollina avatar Jul 08 '21 13:07 mcollina