prometheus + load-testing
This commit is contained in:
24
tests/aircrafts.js
Normal file
24
tests/aircrafts.js
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user