Search code examples
pythontestingperformance-testingload-testinglocust

Inference of Locust result


Locust Report

NUM REQUESTS 500
NUM CLIENTS 50
NUM HATCH RATE 10
 Name                                 # reqs      # fails     Avg     Min     Max  |  Median   req/s
--------------------------------------------------------------------------------------------------------------------------------------------
 POST /someurl                           549     0(0.00%)      43      27     103  |      44   40.90
--------------------------------------------------------------------------------------------------------------------------------------------
 Total                                   549     0(0.00%)                                      40.90

Percentage of the requests completed within given times
 Name                                 # reqs    50%    66%    75%    80%    90%    95%    98%    99%   100%
--------------------------------------------------------------------------------------------------------------------------------------------
 POST /someurl                           549     44     48     50     51     55     57     63     68    103
--------------------------------------------------------------------------------------------------------------------------------------------

Here, the number of failure cases are 0.

The number of requests is 500 but, total requests in report is 549

Can anyone please explain why there is inconsistency.

Thanks in advance!


Solution

  • When you start clients, Locust does two things:

    1. It creates locusts, based on your hatch rate and number of Locusts specified
    2. These all start making requests
    3. Once all Locusts spawn, the number of requests is reset
      • Unless using --no-reset-stats

    Because you are using --no-reset-stats this means that any of the requests made in the hatching period will count towards your total, even though the count for 500 does not start until all are hatched.