change ids
This commit is contained in:
@@ -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 ----------------
|
||||
|
||||
Reference in New Issue
Block a user