Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renamed slave to drone #1173

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

**Fixed bugs:**

- autoscaling slaves resets users [\#1143](https://github.com/locustio/locust/issues/1143)
- autoscaling drones resets users [\#1143](https://github.com/locustio/locust/issues/1143)
- Repeated secure requests with FastHttpLocust crashes in cookie management [\#1138](https://github.com/locustio/locust/issues/1138)
- FastHttpLocust gives ssl error with let's encrypt certs [\#1137](https://github.com/locustio/locust/issues/1137)
- stop\_timeout defined in Locust class takes precedence over --run-time option [\#1117](https://github.com/locustio/locust/issues/1117)
Expand All @@ -52,7 +52,7 @@
- Stop locusts graceful [\#1062](https://github.com/locustio/locust/issues/1062)
- could we report 99.9% percentile in CSV file? [\#1040](https://github.com/locustio/locust/issues/1040)
- Provide an official Docker image [\#849](https://github.com/locustio/locust/issues/849)
- Number of Users Dependent on Number of slaves ? [\#724](https://github.com/locustio/locust/issues/724)
- Number of Users Dependent on Number of drones ? [\#724](https://github.com/locustio/locust/issues/724)
- Allow a fixed RPS rate [\#646](https://github.com/locustio/locust/issues/646)
- nitpick: "\# requests" should be "\# successful requests"? [\#145](https://github.com/locustio/locust/issues/145)
- Display percentiles in the UI instead of just min, max and average [\#140](https://github.com/locustio/locust/issues/140)
Expand Down Expand Up @@ -90,7 +90,7 @@
- Exceptions tab not working for on\_start method [\#269](https://github.com/locustio/locust/issues/269)
- Percentile response time anomalies at 100% [\#254](https://github.com/locustio/locust/issues/254)
- log.py's StdErrWrapper swallows fatal stacktraces [\#163](https://github.com/locustio/locust/issues/163)
- Slave count doesn't get updated in the UI if no more slaves are alive [\#62](https://github.com/locustio/locust/issues/62)
- Slave count doesn't get updated in the UI if no more drones are alive [\#62](https://github.com/locustio/locust/issues/62)

**Closed issues:**

Expand All @@ -109,7 +109,7 @@
- locust's statistic collect N/A records [\#626](https://github.com/locustio/locust/issues/626)
- how to make all locust users wait after executing on\_start method ? [\#611](https://github.com/locustio/locust/issues/611)
- EventHook\(\) fired when locust user has stopped [\#604](https://github.com/locustio/locust/issues/604)
- Is there a way to de-register slave with master on a slave node shutdown? [\#603](https://github.com/locustio/locust/issues/603)
- Is there a way to de-register drone with master on a node shutdown? [\#603](https://github.com/locustio/locust/issues/603)
- Unable to Stop locust from Web interface occasionally [\#602](https://github.com/locustio/locust/issues/602)
- no-web performance data saved [\#601](https://github.com/locustio/locust/issues/601)
- Can you add or can I create a Pull Request to accept a command line option that would enable ALL events \(http requests\) to be logged to a file/location? [\#576](https://github.com/locustio/locust/issues/576)
Expand Down
6 changes: 3 additions & 3 deletions docker_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ _LOCUST_OPTS="-f ${LOCUSTFILE_PATH:-/locustfile.py} -H ${TARGET_URL}"

if [ "${LOCUST_MODE}" = "master" ]; then
_LOCUST_OPTS="${_LOCUST_OPTS} --master"
elif [ "${LOCUST_MODE}" = "slave" ]; then
elif [ "${LOCUST_MODE}" = "drone" ]; then
if [ -z "${LOCUST_MASTER_HOST}" ]; then
echo "ERROR: MASTER_HOST is empty. Slave mode requires a master" >&2
echo "ERROR: MASTER_HOST is empty. Drone mode requires a master" >&2
exit 1
fi

_LOCUST_OPTS="${_LOCUST_OPTS} --slave --master-host=${LOCUST_MASTER_HOST} --master-port=${LOCUST_MASTER_PORT:-5557}"
_LOCUST_OPTS="${_LOCUST_OPTS} --drone --master-host=${LOCUST_MASTER_HOST} --master-port=${LOCUST_MASTER_PORT:-5557}"
fi

echo "Starting Locust in ${LOCUST_MODE} mode..."
Expand Down
8 changes: 4 additions & 4 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,20 @@ To run Locust distributed across multiple processes we would start a master proc
$ locust -f locust_files/my_locust_file.py --master


and then we would start an arbitrary number of slave processes:
and then we would start an arbitrary number of drone processes:

.. code-block:: console

$ locust -f locust_files/my_locust_file.py --slave
$ locust -f locust_files/my_locust_file.py --drone


If we want to run Locust distributed on multiple machines we would also have to specify the master host when
starting the slaves (this is not needed when running Locust distributed on a single machine, since the master
starting the drones (this is not needed when running Locust distributed on a single machine, since the master
host defaults to 127.0.0.1):

.. code-block:: console

$ locust -f locust_files/my_locust_file.py --slave --master-host=192.168.0.100
$ locust -f locust_files/my_locust_file.py --drone --master-host=192.168.0.100


Parameters can also be set in a `config file <https://github.com/bw2/ConfigArgParse#config-file-syntax>`_ (locust.conf or ~/.locust.conf) or in env vars, prefixed by LOCUST\_
Expand Down
30 changes: 15 additions & 15 deletions docs/running-locust-distributed.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ running load tests distributed across multiple machines.
To do this, you start one instance of Locust in master mode using the ``--master`` flag. This is
the instance that will be running Locust's web interface where you start the test and see live
statistics. The master node doesn't simulate any users itself. Instead you have to start one or
—most likely—multiple slave Locust nodes using the ``--slave`` flag, together with the
—most likely—multiple drone Locust nodes using the ``--drone`` flag, together with the
``--master-host`` (to specify the IP/hostname of the master node).

A common set up is to run a single master on one machine, and then run one slave instance per
processor core, on the slave machines.
A common set up is to run a single master on one machine, and then run one drone instance per
processor core, on the drone machines.

.. note::
Both the master and each slave machine, must have a copy of the locust test scripts
Both the master and each drone machine, must have a copy of the locust test scripts
when running Locust distributed.

.. note::
It's recommended that you start a number of simulated users that are greater than
``number of locust classes * number of slaves`` when running Locust distributed.
``number of locust classes * number of drones`` when running Locust distributed.

Otherwise - due to the current implementation -
you might end up with a distribution of the Locust classes that doesn't correspond to the
Locust classes' ``weight`` attribute. And if the hatch rate is lower than the number of slave
nodes, the hatching would occur in "bursts" where all slave node would hatch a single user and
Locust classes' ``weight`` attribute. And if the hatch rate is lower than the number of drone
nodes, the hatching would occur in "bursts" where all drone node would hatch a single user and
then sleep for multiple seconds, hatch another user, sleep and repeat.


Expand All @@ -38,9 +38,9 @@ To start locust in master mode::

locust -f my_locustfile.py --master

And then on each slave (replace ``192.168.0.14`` with IP of the master machine)::
And then on each drone (replace ``192.168.0.14`` with IP of the master machine)::

locust -f my_locustfile.py --slave --master-host=192.168.0.14
locust -f my_locustfile.py --drone --master-host=192.168.0.14


Options
Expand All @@ -52,22 +52,22 @@ Options
Sets locust in master mode. The web interface will run on this node.


``--slave``
``--drone``
-----------

Sets locust in slave mode.
Sets locust in drone mode.


``--master-host=X.X.X.X``
-------------------------

Optionally used together with ``--slave`` to set the hostname/IP of the master node (defaults
Optionally used together with ``--drone`` to set the hostname/IP of the master node (defaults
to 127.0.0.1)

``--master-port=5557``
----------------------

Optionally used together with ``--slave`` to set the port number of the master node (defaults to 5557).
Optionally used together with ``--drone`` to set the port number of the master node (defaults to 5557).
Note that locust will use the port specified, as well as the port number +1. So if 5557 is used, locust
will use both port 5557 and 5558.

Expand All @@ -84,10 +84,10 @@ Optionally used together with ``--master``. Determines what network ports that t
listen to. Defaults to 5557. Note that locust will use the port specified, as well as the port
number +1. So if 5557 is used, locust will use both port 5557 and 5558.

``--expect-slaves=X``
``--expect-drones=X``
---------------------

Used when starting the master node with ``--no-web``. The master node will then wait until X slave
Used when starting the master node with ``--no-web``. The master node will then wait until X drone
nodes has connected before the test is started.


Expand Down
4 changes: 2 additions & 2 deletions docs/running-locust-docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
Running Locust with Docker
=================================

To keep things simple we provide a single Docker image that can run standalone, as a master, or as a slave.
To keep things simple we provide a single Docker image that can run standalone, as a master, or as a drone.

Environment Variables
---------------------------------------------

- ``LOCUST_MODE``

One of 'standalone', 'master', or 'slave'. Defaults to 'standalone'.
One of 'standalone', 'master', or 'drone'. Defaults to 'standalone'.

- ``LOCUSTFILE_PATH``

Expand Down
4 changes: 2 additions & 2 deletions docs/running-locust-without-web-ui.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Running Locust distributed without the web UI
---------------------------------------------

If you want to :ref:`run Locust distributed <running-locust-distributed>` without the web UI,
you should specify the ``--expect-slaves`` option when starting the master node, to specify
the number of slave nodes that are expected to connect. It will then wait until that many slave
you should specify the ``--expect-drones`` option when starting the master node, to specify
the number of drone nodes that are expected to connect. It will then wait until that many drone
nodes have connected before starting the test.

4 changes: 2 additions & 2 deletions docs/third-party-tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Third party tools
Using other languages
=====================

A Locust master and a Locust slave communicate by exchanging `msgpack <http://msgpack.org/>`_ messages, which is
A Locust master and a Locust drone communicate by exchanging `msgpack <http://msgpack.org/>`_ messages, which is
supported by many languages. So, you can write your Locust tasks in any languages you like. For convenience, some
libraries do the job as a slave runner. They run your Locust tasks, and report to master regularly.
libraries do the job as a drone runner. They run your Locust tasks, and report to master regularly.


Golang
Expand Down
4 changes: 2 additions & 2 deletions examples/docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ services:
<<: *common-env
LOCUST_MODE: master

locust-slave:
locust-drone:
<<: *common
environment:
<<: *common-env
LOCUST_MODE: slave
LOCUST_MODE: drone
LOCUST_MASTER_HOST: locust-master
12 changes: 6 additions & 6 deletions examples/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class WebsiteUser(HttpLocust):
We need somewhere to store the stats.

On the master node stats will contain the aggregated sum of all content-lengths,
while on the slave nodes this will be the sum of the content-lengths since the
while on the drone nodes this will be the sum of the content-lengths since the
last stats report was sent to the master
"""
stats = {"content-length":0}
Expand All @@ -40,25 +40,25 @@ def on_request_success(request_type, name, response_time, response_length):

def on_report_to_master(client_id, data):
"""
This event is triggered on the slave instances every time a stats report is
This event is triggered on the drone instances every time a stats report is
to be sent to the locust master. It will allow us to add our extra content-length
data to the dict that is being sent, and then we clear the local stats in the slave.
data to the dict that is being sent, and then we clear the local stats in the drone.
"""
data["content-length"] = stats["content-length"]
stats["content-length"] = 0

def on_slave_report(client_id, data):
def on_drone_report(client_id, data):
"""
This event is triggered on the master instance when a new stats report arrives
from a slave. Here we just add the content-length to the master's aggregated
from a drone. Here we just add the content-length to the master's aggregated
stats dict.
"""
stats["content-length"] += data["content-length"]

# Hook up the event listeners
events.request_success += on_request_success
events.report_to_master += on_report_to_master
events.slave_report += on_slave_report
events.drone_report += on_drone_report

@web.app.route("/content-length")
def total_content_length():
Expand Down
8 changes: 4 additions & 4 deletions examples/vagrant/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ autostart=true
directory=/vagrant
priority=1

[program:locustslaves]
command=locust --slave -f examples/basic.py ; TODO host should perhaps be configurable through the web UI
process_name=slave_%(process_num)s
[program:locustdrones]
command=locust --drone -f examples/basic.py ; TODO host should perhaps be configurable through the web UI
process_name=drone_%(process_num)s
numprocs=2
numprocs_start=1
autostart=true
priority=2
directory=/vagrant
directory=/vagrant
14 changes: 7 additions & 7 deletions locust/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def fire(self, reverse=False, **kwargs):

report_to_master = EventHook()
"""
*report_to_master* is used when Locust is running in --slave mode. It can be used to attach
*report_to_master* is used when Locust is running in --drone mode. It can be used to attach
data to the dicts that are regularly sent to the master. It's fired regularly when a report
is to be sent to the master server.

Expand All @@ -83,17 +83,17 @@ def fire(self, reverse=False, **kwargs):
* *data*: Data dict that can be modified in order to attach data that should be sent to the master.
"""

slave_report = EventHook()
drone_report = EventHook()
"""
*slave_report* is used when Locust is running in --master mode and is fired when the master
server receives a report from a Locust slave server.
*drone_report* is used when Locust is running in --master mode and is fired when the master
server receives a report from a Locust drone server.

This event can be used to aggregate data from the locust slave servers.
This event can be used to aggregate data from the locust drone servers.

Event is fired with following arguments:

* *client_id*: Client id of the reporting locust slave
* *data*: Data dict with the data from the slave node
* *client_id*: Client id of the reporting locust drone
* *data*: Data dict with the data from the drone node
"""

hatch_complete = EventHook()
Expand Down
Loading