fix(load): send the exact assessment request count

This commit is contained in:
2026-09-20 10:40:33 +03:30
parent f45c457dc8
commit cd8fe33d08

View File

@@ -6,17 +6,15 @@ import exec from 'k6/execution';
const API_URL = __ENV.API_URL || 'http://localhost:8000/api/v1/cdr/raw'; const API_URL = __ENV.API_URL || 'http://localhost:8000/api/v1/cdr/raw';
const PROFILE = (__ENV.PROFILE || 'assessment').toLowerCase(); const PROFILE = (__ENV.PROFILE || 'assessment').toLowerCase();
const P95_MS = Number(__ENV.P95_MS || 50); const P95_MS = __ENV.P95_MS ? Number(__ENV.P95_MS) : null;
// Assessment profile directly models the required scenario: // Assessment profile directly models the required scenario:
// 500 records in <5s. 125 iterations/s for 4 seconds schedules exactly 500 iterations. // 500 records in <5s. 125 iterations/s for 4 seconds schedules exactly 500 iterations.
const assessmentScenario = { const assessmentScenario = {
executor: 'constant-arrival-rate', executor: 'shared-iterations',
rate: 125, vus: 50,
timeUnit: '1s', iterations: 500,
duration: '4s', maxDuration: '5s',
preAllocatedVUs: 50,
maxVUs: 250,
gracefulStop: '5s', gracefulStop: '5s',
}; };
@@ -50,9 +48,10 @@ export const options = {
assessment_completion_ms: ['max<5000'], assessment_completion_ms: ['max<5000'],
} : {}), } : {}),
// This is a project performance guardrail, not an assessment requirement. // Optional project performance guardrail; the assessment defines no p95 SLA.
// Override it with P95_MS=100 (etc.) if you want a different SLA. ...(Number.isFinite(P95_MS) && P95_MS > 0 ? {
http_req_duration: [`p(95)<${P95_MS}`], http_req_duration: [`p(95)<${P95_MS}`],
} : {}),
}, },
}; };