5장. k6 threshold로 통과·실패를 코드화한다
import http from 'k6/http';
export const options={
scenarios:{peak:{executor:'constant-arrival-rate',rate:120,timeUnit:'1s',duration:'5m',preAllocatedVUs:80}},
thresholds:{http_req_failed:['rate<0.01'],http_req_duration:['p(95)<300']}
};
export default function(){http.get(`${__ENV.BASE_URL}/health/ready`)}
health endpoint만 빠른 테스트로 전체 서비스를 평가하지 않는다. 예약 생성은 합성 user·slot·idempotency key를 사용하고 종료 뒤 불변식을 대사한다. 부하는 승인한 격리 환경에만 발생시키며 제3자 사이트를 대상으로 실행하지 않는다.