Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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!

>Solution :

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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading