From 305b4d562f2becd9a2bb0b60f85e66967f0e3a00 Mon Sep 17 00:00:00 2001 From: ITO Mac Date: Mon, 4 May 2026 19:48:02 +0200 Subject: [PATCH] . --- k8s/deployment.yaml | 2 +- test/locustfile.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 test/locustfile.py diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index 8276a9a..a898cf5 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -6,7 +6,7 @@ metadata: app: zadaca-deployment namespace: student-blazp04 spec: - replicas: 1 + replicas: 3 selector: matchLabels: app: zadaca diff --git a/test/locustfile.py b/test/locustfile.py new file mode 100644 index 0000000..cee10b3 --- /dev/null +++ b/test/locustfile.py @@ -0,0 +1,19 @@ +from locust import HttpUser, task, between +import random +import urllib3 +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) + + +class MojServisUser(HttpUser): + """ + Simulira korisnika koji koristi moj-servis API. + """ + + wait_time = between(1, 3) + + @task(5) + def health(self): + self.client.get("/health", name="GET /health", verify=False) + + def on_start(self): + print(f"Novi virtualni korisnik startan")