Locust ' check avg response time' env variable not working
I'm new to locust. I have installed locust along with locust-plugins and am using locust.conf
to set most of the configurations from a .conf
I have added:
import locust_plugins
to the top of the locustfile.py
I have also tried to set the env var:
LOCUST_CHECK_AVG_RESPONSE_TIME=0.1
but in the results I still don't see any test failures, even though the avg response time is clearly more than 0.1ms:
0 11279
is what I get for fails and ms.
Could anyone please help me here. Thank you!
Thats not what —check-avg-response-time
does. It checks the average response time for the whole test. At the end of the test run it prints the result of the check and sets the exit code of the locust process. It does not fail individual requests.
To fail requests based on response times, you need to use this approach: http://docs.locust.io/en/stable/writing-a-locustfile.html#validating-responses