cara/server-performance-tests/README.md

18 lines
949 B
Markdown
Raw Permalink Normal View History

2021-12-06 10:55:58 +00:00
# locust
A simple open source load testing tool that allows to define user behavior.
In order to set it up for the first time, we followed the documentation at https://locust.io/. In particular, we:
* Defined a class for the users that will be simulating.
* Defined a ``wait_time`` variable that will make the simulated users wait between the specified seconds after each task executed.
* Decorated our method with ``@Task`` that creates a micro-thread that calls this method.
* Defined the ``self.client`` attribute that makes it possible to make HTTP calls that will be logged by Locust.
To use, uncomment the desired method on ``lucust.py``` file, open the terminal on this folder and run the following command:
2021-12-06 10:55:58 +00:00
``locust -f locust.py --host https://caimira.web.cern.ch``
2021-12-06 10:55:58 +00:00
Then, open up a browser and point it to http://localhost:8089.
By default we pointed out the test to our own web server.
``Start swarming`` will trigger the simulation.