Skip to content

Commit

Permalink
Update some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberw committed Dec 9, 2021
1 parent ea14643 commit a26bc0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions docs/testing-other-systems.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
=======================================
Expand Down

0 comments on commit a26bc0f

Please sign in to comment.