prometheus + load-testing

This commit is contained in:
PxlLoewe
2025-06-28 16:05:44 -07:00
parent 246ce0ce22
commit 453cf9a414
20 changed files with 8171 additions and 404 deletions

24
tests/aircrafts.js Normal file
View File

@@ -0,0 +1,24 @@
import http from "k6/http";
import { check, sleep } from "k6";
export const options = {
vus: 10, // virtuelle Nutzer gleichzeitig
duration: "30s", // Testdauer
};
export default function () {
const res = http.get("https://dispatch.premiumag.de/api/aircrafts");
const res2 = http.get("https://dispatch.premiumag.de/api/dispatcher");
check(res, {
"Status Piloten ist 200": (r) => r.status === 200,
"Antwort enthält Daten": (r) => r.body && r.body.length > 1,
});
check(res2, {
"Status Dispatcher ist 200": (r) => r.status === 200,
"Antwort enthält Daten": (r) => r.body && r.body.length > 1,
});
sleep(1); // optional, Wartezeit zwischen Requests
}