mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-13 06:39:04 +08:00
chore: 🔧 upgrade distributed locust to 1.2.3 and updated related files
Signed-off-by: Prashant Shahi <prashant@signoz.io>
This commit is contained in:
parent
652bd52ea7
commit
a1a5e8bf9b
@ -66,7 +66,7 @@ To generate load:
|
||||
```sh
|
||||
kubectl -n sample-application run strzal --image=djbingham/curl \
|
||||
--restart='OnFailure' -i --tty --rm --command -- curl -X POST -F \
|
||||
'locust_count=6' -F 'hatch_rate=2' http://locust-master:8089/swarm
|
||||
'user_count=6' -F 'spawn_rate=2' http://locust-master:8089/swarm
|
||||
```
|
||||
|
||||
To stop load:
|
||||
|
@ -16,7 +16,7 @@ fi
|
||||
# Locust's docker image
|
||||
if [[ -z $LOCUST_IMAGE ]]; then
|
||||
LOCUST_REPO="${LOCUST_REPO:-signoz/locust}"
|
||||
LOCUST_TAG="${LOCUST_TAG:-0.8.1-py3.6}"
|
||||
LOCUST_TAG="${LOCUST_TAG:-1.2.3}"
|
||||
LOCUST_IMAGE="${LOCUST_REPO}:${LOCUST_TAG}"
|
||||
fi
|
||||
|
||||
|
@ -11,8 +11,10 @@ metadata:
|
||||
name: scripts-cm
|
||||
data:
|
||||
locustfile.py: |
|
||||
from locust import HttpLocust, TaskSet, task
|
||||
class UserTasks(TaskSet):
|
||||
from locust import HttpUser, task, between
|
||||
class UserTasks(HttpUser):
|
||||
wait_time = between(5, 15)
|
||||
|
||||
@task
|
||||
def rachel(self):
|
||||
self.client.get("/dispatch?customer=123&nonse=0.6308392664170006")
|
||||
@ -25,8 +27,6 @@ data:
|
||||
@task
|
||||
def coffee(self):
|
||||
self.client.get("/dispatch?customer=567&nonse=0.0022220379420636593")
|
||||
class WebsiteUser(HttpLocust):
|
||||
task_set = UserTasks
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
@ -155,13 +155,13 @@ metadata:
|
||||
annotations:
|
||||
deployment.kubernetes.io/revision: "1"
|
||||
labels:
|
||||
role: locust-slave
|
||||
name: locust-slave
|
||||
role: locust-worker
|
||||
name: locust-worker
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
role: locust-slave
|
||||
role: locust-worker
|
||||
strategy:
|
||||
rollingUpdate:
|
||||
maxSurge: 1
|
||||
@ -170,12 +170,12 @@ spec:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
role: locust-slave
|
||||
role: locust-worker
|
||||
spec:
|
||||
containers:
|
||||
- image: ${LOCUST_IMAGE}
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: locust-slave
|
||||
name: locust-worker
|
||||
env:
|
||||
- name: ATTACKED_HOST
|
||||
valueFrom:
|
||||
@ -183,8 +183,8 @@ spec:
|
||||
name: locust-cm
|
||||
key: ATTACKED_HOST
|
||||
- name: LOCUST_MODE
|
||||
value: SLAVE
|
||||
- name: LOCUST_MASTER
|
||||
value: WORKER
|
||||
- name: LOCUST_MASTER_HOST
|
||||
value: locust-master
|
||||
volumeMounts:
|
||||
- mountPath: /locust
|
||||
|
@ -11,8 +11,10 @@ metadata:
|
||||
name: scripts-cm
|
||||
data:
|
||||
locustfile.py: |
|
||||
from locust import HttpLocust, TaskSet, task
|
||||
class UserTasks(TaskSet):
|
||||
from locust import HttpUser, task, between
|
||||
class UserTasks(HttpUser):
|
||||
wait_time = between(5, 15)
|
||||
|
||||
@task
|
||||
def rachel(self):
|
||||
self.client.get("/dispatch?customer=123&nonse=0.6308392664170006")
|
||||
@ -25,8 +27,6 @@ data:
|
||||
@task
|
||||
def coffee(self):
|
||||
self.client.get("/dispatch?customer=567&nonse=0.0022220379420636593")
|
||||
class WebsiteUser(HttpLocust):
|
||||
task_set = UserTasks
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
@ -155,13 +155,13 @@ metadata:
|
||||
annotations:
|
||||
deployment.kubernetes.io/revision: "1"
|
||||
labels:
|
||||
role: locust-slave
|
||||
name: locust-slave
|
||||
role: locust-worker
|
||||
name: locust-worker
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
role: locust-slave
|
||||
role: locust-worker
|
||||
strategy:
|
||||
rollingUpdate:
|
||||
maxSurge: 1
|
||||
@ -170,12 +170,12 @@ spec:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
role: locust-slave
|
||||
role: locust-worker
|
||||
spec:
|
||||
containers:
|
||||
- image: signoz/locust:1.2.3
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: locust-slave
|
||||
name: locust-worker
|
||||
env:
|
||||
- name: ATTACKED_HOST
|
||||
valueFrom:
|
||||
@ -183,8 +183,8 @@ spec:
|
||||
name: locust-cm
|
||||
key: ATTACKED_HOST
|
||||
- name: LOCUST_MODE
|
||||
value: SLAVE
|
||||
- name: LOCUST_MASTER
|
||||
value: WORKER
|
||||
- name: LOCUST_MASTER_HOST
|
||||
value: locust-master
|
||||
volumeMounts:
|
||||
- mountPath: /locust
|
||||
|
Loading…
x
Reference in New Issue
Block a user