diff --git a/k6/02-reservation-concurrency.js b/k6/02-reservation-concurrency.js index 3fc22af..baa2db8 100644 --- a/k6/02-reservation-concurrency.js +++ b/k6/02-reservation-concurrency.js @@ -30,6 +30,8 @@ const errorRate = new Rate('reservation_error_rate'); const reserveDuration = new Trend('reservation_duration', true); export const options = { + // stdout 메트릭에 p99 노출 (기본은 p95까지만) + summaryTrendStats: ['avg', 'min', 'med', 'max', 'p(95)', 'p(99)'], scenarios: { // 100명이 동시에 한꺼번에 예약 요청 — 스파이크 시나리오 spike: { diff --git a/k6/08-coupon-issue.js b/k6/08-coupon-issue.js index 98b30fc..77b9e87 100644 --- a/k6/08-coupon-issue.js +++ b/k6/08-coupon-issue.js @@ -60,6 +60,8 @@ const issueDuration = new Trend('coupon_issue_duration', true); const errorRate = new Rate('coupon_error_rate'); export const options = { + // stdout 메트릭에 p99 노출 (기본은 p95까지만 → 결과 출력에서 p99=0 표시 버그 해소) + summaryTrendStats: ['avg', 'min', 'med', 'max', 'p(95)', 'p(99)'], scenarios: { // 선착순 스파이크: 5초 만에 50명 동시 요청 spike: { diff --git a/k6/11-vacancy-test.js b/k6/11-vacancy-test.js index 461e0e8..d19374a 100644 --- a/k6/11-vacancy-test.js +++ b/k6/11-vacancy-test.js @@ -183,7 +183,10 @@ const redisClient = (PHASE === 'smembers' || PHASE === 'ttl') ? new redis.Client export const options = (() => { if (PHASE === 'subscribe') { - return { vus: N, iterations: N }; + // per-vu-iterations: 각 VU가 정확히 1 iter씩 → N개 토큰이 1:1로 사용됨. + // 기존 { vus: N, iterations: N } shared 모드는 빠른 VU가 추가 iter를 가져가 + // TOKENS 분배가 불균등해짐 (실측: VU 1~10만 사용되어 SCARD가 10). + return { scenarios: { default: { executor: 'per-vu-iterations', vus: N, iterations: 1 } } }; } if (PHASE === 'smembers') { // 단일 VU 가 N 번 반복 - SMEMBERS 자체 응답시간 분포만 본다.