mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 20:45:54 +08:00
Merge pull request #3096 from SigNoz/chore/hotrod-locust
chore: 🔧 upgrade distributed locust to 1.2.3 and updated related files
This commit is contained in:
commit
915738e1f7
@ -66,7 +66,7 @@ To generate load:
|
|||||||
```sh
|
```sh
|
||||||
kubectl -n sample-application run strzal --image=djbingham/curl \
|
kubectl -n sample-application run strzal --image=djbingham/curl \
|
||||||
--restart='OnFailure' -i --tty --rm --command -- curl -X POST -F \
|
--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:
|
To stop load:
|
||||||
|
@ -5,7 +5,7 @@ Follow the steps in this section to install a sample application named HotR.O.D,
|
|||||||
```console
|
```console
|
||||||
kubectl create ns sample-application
|
kubectl create ns sample-application
|
||||||
|
|
||||||
kubectl -n sample-application apply -f https://github.com/SigNoz/signoz/raw/main/sample-apps/hotrod/hotrod.yaml
|
kubectl -n sample-application apply -f https://github.com/SigNoz/signoz/raw/develop/sample-apps/hotrod/hotrod.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
In case, you have installed SigNoz in namespace other than `platform` or selected Helm release name other than `my-release`, follow the steps below:
|
In case, you have installed SigNoz in namespace other than `platform` or selected Helm release name other than `my-release`, follow the steps below:
|
||||||
@ -15,7 +15,7 @@ export HELM_RELEASE=my-release-2
|
|||||||
export SIGNOZ_NAMESPACE=platform-2
|
export SIGNOZ_NAMESPACE=platform-2
|
||||||
export HOTROD_NAMESPACE=sample-application-2
|
export HOTROD_NAMESPACE=sample-application-2
|
||||||
|
|
||||||
curl -sL https://github.com/SigNoz/signoz/raw/main/sample-apps/hotrod/hotrod-install.sh | bash
|
curl -sL https://github.com/SigNoz/signoz/raw/develop/sample-apps/hotrod/hotrod-install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
To delete sample application:
|
To delete sample application:
|
||||||
@ -23,5 +23,15 @@ To delete sample application:
|
|||||||
```console
|
```console
|
||||||
export HOTROD_NAMESPACE=sample-application-2
|
export HOTROD_NAMESPACE=sample-application-2
|
||||||
|
|
||||||
curl -sL https://github.com/SigNoz/signoz/raw/main/sample-apps/hotrod/hotrod-delete.sh | bash
|
curl -sL https://github.com/SigNoz/signoz/raw/develop/sample-apps/hotrod/hotrod-delete.sh | bash
|
||||||
|
```
|
||||||
|
|
||||||
|
For testing with local scripts, you can use the following commands:
|
||||||
|
|
||||||
|
```console
|
||||||
|
# To install hotrod
|
||||||
|
cat hotrod-install.sh | bash
|
||||||
|
|
||||||
|
# To delete hotrod
|
||||||
|
cat hotrod-delete.sh | bash
|
||||||
```
|
```
|
||||||
|
@ -16,7 +16,7 @@ fi
|
|||||||
# Locust's docker image
|
# Locust's docker image
|
||||||
if [[ -z $LOCUST_IMAGE ]]; then
|
if [[ -z $LOCUST_IMAGE ]]; then
|
||||||
LOCUST_REPO="${LOCUST_REPO:-signoz/locust}"
|
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}"
|
LOCUST_IMAGE="${LOCUST_REPO}:${LOCUST_TAG}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -11,8 +11,10 @@ metadata:
|
|||||||
name: scripts-cm
|
name: scripts-cm
|
||||||
data:
|
data:
|
||||||
locustfile.py: |
|
locustfile.py: |
|
||||||
from locust import HttpLocust, TaskSet, task
|
from locust import HttpUser, task, between
|
||||||
class UserTasks(TaskSet):
|
class UserTasks(HttpUser):
|
||||||
|
wait_time = between(5, 15)
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def rachel(self):
|
def rachel(self):
|
||||||
self.client.get("/dispatch?customer=123&nonse=0.6308392664170006")
|
self.client.get("/dispatch?customer=123&nonse=0.6308392664170006")
|
||||||
@ -25,8 +27,6 @@ data:
|
|||||||
@task
|
@task
|
||||||
def coffee(self):
|
def coffee(self):
|
||||||
self.client.get("/dispatch?customer=567&nonse=0.0022220379420636593")
|
self.client.get("/dispatch?customer=567&nonse=0.0022220379420636593")
|
||||||
class WebsiteUser(HttpLocust):
|
|
||||||
task_set = UserTasks
|
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
@ -155,13 +155,13 @@ metadata:
|
|||||||
annotations:
|
annotations:
|
||||||
deployment.kubernetes.io/revision: "1"
|
deployment.kubernetes.io/revision: "1"
|
||||||
labels:
|
labels:
|
||||||
role: locust-slave
|
role: locust-worker
|
||||||
name: locust-slave
|
name: locust-worker
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
role: locust-slave
|
role: locust-worker
|
||||||
strategy:
|
strategy:
|
||||||
rollingUpdate:
|
rollingUpdate:
|
||||||
maxSurge: 1
|
maxSurge: 1
|
||||||
@ -170,12 +170,12 @@ spec:
|
|||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
role: locust-slave
|
role: locust-worker
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- image: ${LOCUST_IMAGE}
|
- image: ${LOCUST_IMAGE}
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
name: locust-slave
|
name: locust-worker
|
||||||
env:
|
env:
|
||||||
- name: ATTACKED_HOST
|
- name: ATTACKED_HOST
|
||||||
valueFrom:
|
valueFrom:
|
||||||
@ -183,8 +183,8 @@ spec:
|
|||||||
name: locust-cm
|
name: locust-cm
|
||||||
key: ATTACKED_HOST
|
key: ATTACKED_HOST
|
||||||
- name: LOCUST_MODE
|
- name: LOCUST_MODE
|
||||||
value: SLAVE
|
value: WORKER
|
||||||
- name: LOCUST_MASTER
|
- name: LOCUST_MASTER_HOST
|
||||||
value: locust-master
|
value: locust-master
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /locust
|
- mountPath: /locust
|
||||||
|
@ -11,8 +11,10 @@ metadata:
|
|||||||
name: scripts-cm
|
name: scripts-cm
|
||||||
data:
|
data:
|
||||||
locustfile.py: |
|
locustfile.py: |
|
||||||
from locust import HttpLocust, TaskSet, task
|
from locust import HttpUser, task, between
|
||||||
class UserTasks(TaskSet):
|
class UserTasks(HttpUser):
|
||||||
|
wait_time = between(5, 15)
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def rachel(self):
|
def rachel(self):
|
||||||
self.client.get("/dispatch?customer=123&nonse=0.6308392664170006")
|
self.client.get("/dispatch?customer=123&nonse=0.6308392664170006")
|
||||||
@ -25,8 +27,6 @@ data:
|
|||||||
@task
|
@task
|
||||||
def coffee(self):
|
def coffee(self):
|
||||||
self.client.get("/dispatch?customer=567&nonse=0.0022220379420636593")
|
self.client.get("/dispatch?customer=567&nonse=0.0022220379420636593")
|
||||||
class WebsiteUser(HttpLocust):
|
|
||||||
task_set = UserTasks
|
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
@ -155,13 +155,13 @@ metadata:
|
|||||||
annotations:
|
annotations:
|
||||||
deployment.kubernetes.io/revision: "1"
|
deployment.kubernetes.io/revision: "1"
|
||||||
labels:
|
labels:
|
||||||
role: locust-slave
|
role: locust-worker
|
||||||
name: locust-slave
|
name: locust-worker
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
role: locust-slave
|
role: locust-worker
|
||||||
strategy:
|
strategy:
|
||||||
rollingUpdate:
|
rollingUpdate:
|
||||||
maxSurge: 1
|
maxSurge: 1
|
||||||
@ -170,12 +170,12 @@ spec:
|
|||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
role: locust-slave
|
role: locust-worker
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- image: signoz/locust:1.2.3
|
- image: signoz/locust:1.2.3
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
name: locust-slave
|
name: locust-worker
|
||||||
env:
|
env:
|
||||||
- name: ATTACKED_HOST
|
- name: ATTACKED_HOST
|
||||||
valueFrom:
|
valueFrom:
|
||||||
@ -183,8 +183,8 @@ spec:
|
|||||||
name: locust-cm
|
name: locust-cm
|
||||||
key: ATTACKED_HOST
|
key: ATTACKED_HOST
|
||||||
- name: LOCUST_MODE
|
- name: LOCUST_MODE
|
||||||
value: SLAVE
|
value: WORKER
|
||||||
- name: LOCUST_MASTER
|
- name: LOCUST_MASTER_HOST
|
||||||
value: locust-master
|
value: locust-master
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /locust
|
- mountPath: /locust
|
||||||
|
Loading…
x
Reference in New Issue
Block a user