글

라벨이 option인 게시물 표시

K6 testing 간단한 GET 부하 테스트

이미지
 테스트 프로젝트에 js파일을 생성합니다. (testing1.js) // simpleGetTest/testing1.js import http from 'k6/http' ; import { sleep } from 'k6' ; export default function () { http . get ( '[테스트 하기 위한 URL정보]' ); sleep ( 1 ); } 매우 간단한 테스트 입니다. 1회만 해당 URL에 GET요청을 하고 status코드가 200이 오는지 확인합니다. import { sleep } from "k6" import http from "k6/http" // 테스트 옵션 // 10명의 가상 유저들이 30초간 export const options = { vus : 10 , // 10명의 가상 유저 duration : "30s" , // 30초간 } export default function () { http . get ( "[테스트 하기 위한 URL정보]" ) sleep ( 1 ) } 다음 테스트는 옵션을 줘서 10명의 유저가 30초간 GET요청을 하는 테스트입니다. import { sleep } from "k6" import http from "k6/http" // 테스트 옵션 export const options = { stages : [ { duration : "30s" , target : 20 }, // 30초동안 20명의 유저가 점진적으로 늘어난다 { duration : "1m30s" , target : 10 }, // 1분30초동안 10명의 유저가 유지된다. { duration : "20s" , target...