From a26bc0f76b524b1ed828023cbf061c16279eb899 Mon Sep 17 00:00:00 2001 From: Lars Holmberg <lars.holmberg@svenskaspel.se> Date: Thu, 9 Dec 2021 22:11:54 +0100 Subject: [PATCH] Update some docs --- README.md | 2 +- docs/testing-other-systems.rst | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 347d76d2ef..2d29e76ca2 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,8 @@ Locust's code base is intentionally kept small and doesnt solve everything out o * Website: [locust.io](https://locust.io) * Documentation: [docs.locust.io](https://docs.locust.io) -* Code/issues: [Github](https://github.com/locustio/locust) * Support/Questions: [StackOverflow](https://stackoverflow.com/questions/tagged/locust) +* Code/issues: [Github](https://github.com/locustio/locust) * Chat/discussion: [Slack signup](https://slack.locust.io/) ## Authors diff --git a/docs/testing-other-systems.rst b/docs/testing-other-systems.rst index 0926cedf71..96bbe648f3 100644 --- a/docs/testing-other-systems.rst +++ b/docs/testing-other-systems.rst @@ -4,13 +4,15 @@ Testing non-HTTP systems ======================== -Locust only comes with built-in support for HTTP/HTTPS but it can be extended to load test almost any system. You do this by writing a custom client that triggers :py:attr:`request <locust.event.Events.request>` +Locust only comes with built-in support for HTTP/HTTPS but it can be extended to test almost any system. This is done by wrapping the protocol library and triggering a :py:attr:`request <locust.event.Events.request>` event after each call has completed, to let Locust know what happened. .. note:: - It is important that any protocol libraries you use can be `monkey-patched <http://www.gevent.org/intro.html#monkey-patching>`_ by gevent (if they use the Python ``socket`` module or some other standard library function like ``subprocess`` you will be fine). Otherwise your calls will block the whole Locust/Python process (in practice limiting you to running a single User per worker process) + It is important that the protocol libraries you use can be `monkey-patched <http://www.gevent.org/intro.html#monkey-patching>`_ by gevent. + + Almost any libraries that are pure Python (using the Python ``socket`` module or some other standard library function like ``subprocess``) should work fine out of the box - but if they do their I/O calls in C gevent will be unable to patch it. This will block the whole Locust/Python process (in practice limiting you to running a single User per worker process) - Some C libraries cannot be monkey patched by gevent, but allow for other workarounds. For example, if you want to use psycopg2 to performance test PostgreSQL, you can use `psycogreen <https://github.com/psycopg/psycogreen/>`_. + Some C libraries allow for other workarounds. For example, if you want to use psycopg2 to performance test PostgreSQL, you can use `psycogreen <https://github.com/psycopg/psycogreen/>`_. If you are willing to get your hands dirty, you may also be able to do patch a library yourself, but that is beyond the scope of this documentation. Example: writing an XML-RPC User/client =======================================