-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into geventhttpclientmergeconflicts
- Loading branch information
Showing
35 changed files
with
1,399 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
[run] | ||
branch = True | ||
source = locust | ||
concurrency = gevent | ||
|
||
[report] | ||
exclude_lines = | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## Release Process | ||
|
||
* Run github_changelog_generator to update `CHANGELOG.md` | ||
- `github_changelog_generator -u Locustio -p Locust -t $CHANGELOG_GITHUB_TOKEN` | ||
* Add highlights to changelog in docs: `locust/docs/changelog.rst` | ||
* Update `locust/__init__.py` with new version number: `__version__ = "VERSION"` | ||
* Tag master as "VERSION" in git | ||
* Build VERSION package and upload to PyPI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM python:3.6.6-alpine3.8 | ||
|
||
RUN apk --no-cache add g++ \ | ||
&& apk --no-cache add zeromq-dev \ | ||
&& pip install locustio pyzmq | ||
|
||
EXPOSE 8089 5557 5558 | ||
|
||
ENTRYPOINT ["/usr/local/bin/locust"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
include LICENSE | ||
recursive-include locust/static * | ||
recursive-include locust/templates * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ -z "${TARGET_URL}" ]; then | ||
echo "ERROR: TARGET_URL not configured" >&2 | ||
exit 1 | ||
fi | ||
|
||
LOCUST_MODE="${LOCUST_MODE:=standalone}" | ||
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 | ||
if [ -z "${LOCUST_MASTER_HOST}" ]; then | ||
echo "ERROR: MASTER_HOST is empty. Slave mode requires a master" >&2 | ||
exit 1 | ||
fi | ||
|
||
LOCUST_OPTS="${LOCUST_OPTS} --slave --master-host=${LOCUST_MASTER_HOST} --master-port=${LOCUST_MASTER_PORT:-5557}" | ||
fi | ||
|
||
echo "Starting Locust..." | ||
echo "$ locust ${LOCUST_OPTS}" | ||
|
||
locust ${LOCUST_OPTS} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
.. _running-locust-docker: | ||
|
||
================================= | ||
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. | ||
|
||
|
||
Environment Variables | ||
--------------------------------------------- | ||
|
||
- ``LOCUST_MODE`` | ||
|
||
One of 'standalone', 'master', or 'slave'. Defaults to 'standalone'. | ||
|
||
- ``LOCUSTFILE_PATH`` | ||
|
||
The path inside the container to the locustfile. Defaults to '/locustfile.py` | ||
|
||
- ``LOCUST_MASTER_HOST`` | ||
|
||
The hostname of the master. | ||
|
||
- ``LOCUST_MASTER_PORT`` | ||
|
||
The port used to communicate with the master. Defaults to 5557. | ||
|
||
|
||
Add your tests | ||
--------------------------------------------- | ||
|
||
The easiest way to get your tests running is to build an image with your test file built in. Once you've | ||
written your locustfile you can bake it into a Docker image with a simple ``Dockerfile``: | ||
|
||
``` | ||
FROM locustio/locust | ||
ADD locustfile.py locustfile.py | ||
``` | ||
|
||
You'll need to push the built image to a Docker repository such as Dockerhub, AWS ECR, or GCR in order for | ||
distributed infrastructure to be able to pull the image. See your chosen repository's documentation on how | ||
to authenticate with the repository to pull the image. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
version: "3.4" | ||
|
||
x-common: &common | ||
image: locustio/locust | ||
environment: &common-env | ||
TARGET_URL: http://locust-master:8089 | ||
LOCUSTFILE_PATH: /tests/basic.py | ||
volumes: | ||
- ../:/tests | ||
|
||
services: | ||
locust-master: | ||
<<: *common | ||
ports: | ||
- 8089:8089 | ||
environment: | ||
<<: *common-env | ||
LOCUST_MODE: master | ||
|
||
locust-slave: | ||
<<: *common | ||
environment: | ||
<<: *common-env | ||
LOCUST_MODE: slave | ||
LOCUST_MASTER_HOST: locust-master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from .core import HttpLocust, Locust, TaskSet, TaskSequence, task, seq_task | ||
from .exception import InterruptTaskSet, ResponseError, RescheduleTaskImmediately | ||
|
||
__version__ = "0.8.1" | ||
__version__ = "0.11.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.