Skip to content

Commit 0513ffe

Browse files
author
mrMosi
committed
remove two versions that don't have a git branch, update docker-compose config and locustfile to comply with versions <=1.14.5
1 parent a667803 commit 0513ffe

File tree

6 files changed

+2166
-1328
lines changed

6 files changed

+2166
-1328
lines changed

google/fingerprinters/web/scripts/updater/community/locust/app/docker-compose.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ services:
33
image: "locustio/locust:${LC_VERSION}"
44
ports:
55
- "8089:8089"
6+
# entrypoint is needed only for versions <=1.14.5
7+
entrypoint: [ "locust" ]
68
volumes:
79
- ./locustfile.py:/mnt/locust/locustfile.py
810
command: -f /mnt/locust/locustfile.py --master -H http://master:8089
911
healthcheck:
1012
test: [ "CMD", "python3", "-c", "import socket; socket.create_connection(('localhost', 8089), timeout=1)" ]
1113
interval: 3s
12-
retries: 10
14+
retries: 10
15+
# environments are needed for versions <=1.14.5
16+
environment:
17+
TARGET_URL: http://locust-master:8089
18+
LOCUSTFILE_PATH: /mnt/locust/locustfile.py

google/fingerprinters/web/scripts/updater/community/locust/app/locustfile.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,28 @@
55
from locust import HttpLocust as HttpUser, TaskSet, task
66

77

8+
def index(l):
9+
l.client.get("/")
10+
11+
12+
def stats(l):
13+
l.client.get("/stats/requests")
14+
15+
816
class UserTasks(TaskSet):
17+
# one can specify tasks like this
18+
tasks = [index, stats]
19+
20+
# but it might be convenient to use the @task decorator
921
@task
10-
def hello_world(self):
22+
def page404(self):
23+
self.client.get("/does_not_exist")
1124
self.client.get("/hello")
1225
self.client.get("/world")
1326

1427

1528
class HelloWorldUser(HttpUser):
1629
host = "http://127.0.0.1:8089"
30+
tasks = [UserTasks]
31+
# version <= 1.14.5
1732
task_set = UserTasks

google/fingerprinters/web/scripts/updater/community/locust/getAllTags.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

google/fingerprinters/web/scripts/updater/community/locust/update.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ for LC_VERSION in "${ALL_VERSIONS[@]}"; do
7474
checkOutRepo "${GIT_REPO}" "${LC_VERSION}"
7575

7676
updateFingerprint \
77-
"locust" \
77+
"Locust" \
7878
"${LC_VERSION}" \
7979
"${FINGERPRINTS_PATH}" \
8080
"${GIT_REPO}" \

google/fingerprinters/web/scripts/updater/community/locust/versions.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
2.31.2
2020
2.31.1
2121
2.31.0
22-
2.30.1
2322
2.29.1
2423
2.29.0
2524
2.28.0
@@ -32,7 +31,6 @@
3231
2.23.0
3332
2.22.0
3433
2.21.0
35-
2.20.2
3634
2.20.1
3735
2.20.0
3836
2.19.1

0 commit comments

Comments
 (0)