Skip to content

Commit

Permalink
quickstart: move wait_time back to the top
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberw committed May 19, 2020
1 parent 98a3d7e commit d043692
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Example locustfile.py
from locust import HttpUser, task, between
class QuickstartUser(HttpUser):
wait_time = between(5, 9)
@task
def hello(self):
self.client.get("/hello")
Expand All @@ -27,7 +29,6 @@ Example locustfile.py
def on_start(self):
self.client.post("/login", {"username":"foo", "password":"bar"})
wait_time = between(5, 9)
.. rubric:: Let's break it down

Expand All @@ -49,6 +50,12 @@ can be used to make HTTP requests to the target system that we want to load test
locust will create an instance of this class for every user that it simulates, and each of these
users will start running within their own green gevent thread.

.. code-block:: python
wait_time = between(5, 9)
Our class defines a ``wait_time`` function that will make the simulated users wait between 5 and 9 seconds after each task
is executed. For more info see :ref:`wait-time`.

.. code-block:: python
Expand Down Expand Up @@ -81,13 +88,6 @@ Note that only methods decorated with ``@task`` will be called, so you can defin
Additionally we've declared a `on_start` method. A method with this name will be called for each simulated
user when they start. For more info see :ref:`on-start-on-stop`.

.. code-block:: python
wait_time = between(5, 9)
Our class defines a ``wait_time`` function that will make the simulated users wait between 5 and 9 seconds after each task
is executed. For more info see :ref:`wait-time`.

Start Locust
============

Expand Down

0 comments on commit d043692

Please sign in to comment.