25 lines
671 B
JavaScript
25 lines
671 B
JavaScript
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
|
|
}
|