change ids
All checks were successful
Build and Publish / Metadata (push) Successful in 3s
Build and Publish / BuildAndDeployAmd64 (push) Successful in 50s
Build and Publish / BuildAndDeployArm64 (push) Successful in 4m25s

This commit is contained in:
matst80
2025-10-10 21:50:18 +00:00
parent b0e6c8eca8
commit e48a2590bd
13 changed files with 312 additions and 510 deletions

View File

@@ -31,7 +31,7 @@ export const options = {
{ duration: "1m", target: 0 },
],
gracefulStop: "30s",
startTime: "5m",
startTime: "30s",
},
},
thresholds: {
@@ -157,7 +157,7 @@ function addRandomItem() {
country: "no",
});
const start = Date.now();
const res = http.post(baseUrl() + "/", payload, { headers: headers() });
const res = http.post(baseUrl(), payload, { headers: headers() });
const dur = Date.now() - start;
addItemTrend.add(dur, { op: "add" });
if (res.status === 200) {
@@ -182,16 +182,16 @@ function fetchCart() {
// Occasional checkout trigger
function maybeCheckout() {
if (!cartState.cartid) return;
// Small probability
if (Math.random() < 0.02) {
const start = Date.now();
const res = http.get(baseUrl() + "/checkout", { headers: headers() });
const dur = Date.now() - start;
checkoutTrend.add(dur, { op: "checkout" });
updateCookies(res);
if (res.status === 200) checkoutCounter.add(1);
check(res, { "checkout status ok": (r) => r.status === 200 });
}
// // Small probability
// if (Math.random() < 0.02) {
// const start = Date.now();
// const res = http.get(baseUrl() + "/checkout", { headers: headers() });
// const dur = Date.now() - start;
// checkoutTrend.add(dur, { op: "checkout" });
// updateCookies(res);
// if (res.status === 200) checkoutCounter.add(1);
// check(res, { "checkout status ok": (r) => r.status === 200 });
// }
}
// ---------------- k6 lifecycle ----------------