tested k9 reports

This commit is contained in:
Wowieee4
2026-05-17 19:36:46 +07:00
parent d2608e0188
commit c566c026cd
51 changed files with 62875 additions and 114 deletions
@@ -76,11 +76,11 @@ export function ping() {
return res;
}
export function updateFcmToken(token, fcmToken) {
const res = http.post(
`${API_BASE}/auth/fcm-token`,
JSON.stringify({ fcmToken }),
{ headers: authHeaders(token), tags: { endpoint: "fcm_token" } },
export function updateFcmToken(token, fcmToken) {
const res = http.put(
`${API_BASE}/auth/fcm-token`,
JSON.stringify({ fcmToken }),
{ headers: authHeaders(token), tags: { endpoint: "fcm_token" } },
);
metricsHelper.recordEndpoint("fcm_token", res);
return res;
@@ -195,12 +195,39 @@ export const DEFAULT_THRESHOLDS = {
/**
* Relaxed thresholds untuk stress test (ekspektasi lebih longgar).
*/
export const STRESS_THRESHOLDS = {
http_req_duration: ["p(95)<1500", "p(99)<3000"],
http_req_failed: ["rate<0.05"],
walkguide_error_rate: ["rate<0.05"],
walkguide_sos_latency_ms: ["p(95)<500"],
};
export const STRESS_THRESHOLDS = {
http_req_duration: ["p(95)<1500", "p(99)<3000"],
http_req_failed: ["rate<0.05"],
walkguide_error_rate: ["rate<0.05"],
walkguide_sos_latency_ms: ["p(95)<500"],
};
/**
* Threshold untuk smoke test lokal.
* Dipakai saat backend jalan di laptop tetapi database masih remote, sehingga
* angka latency lebih cocok dipakai sebagai bukti run, bukan production SLA.
*/
export const LOCAL_SMOKE_THRESHOLDS = {
http_req_duration: ["p(95)<35000", "p(99)<40000"],
http_req_failed: ["rate<0.10"],
walkguide_error_rate: ["rate<0.10"],
walkguide_endpoint_latency_ms: ["p(95)<35000"],
walkguide_location_latency_ms: ["p(95)<3000"],
walkguide_obstacle_latency_ms: ["p(95)<5000"],
walkguide_sos_latency_ms: ["p(95)<3000"],
walkguide_notif_latency_ms: ["p(95)<5000"],
walkguide_auth_latency_ms: ["p(95)<35000"],
walkguide_timeline_latency_ms: ["p(95)<5000"],
walkguide_pairing_latency_ms: ["p(95)<5000"],
};
export function pickThresholds(overrides = {}) {
const base =
__ENV.BENCH_PROFILE === "local"
? LOCAL_SMOKE_THRESHOLDS
: DEFAULT_THRESHOLDS;
return { ...base, ...overrides };
}
/**
* handleSummary helper — generate output JSON + text.