-
Artillery 사용법Node.js 2021. 12. 22. 21:47
### Artillery
서버가 얼마만큼의 부하를 견딜 수 있는지 부하 테스트를 진행하는 것.
##설치
$ npm I artillery -D
##간단 테스트하기 (터미널 하나는 npm start해주고 하나는 명령어 실행)$ npx artillery quick --count 100 -n 50 http://localhost:4001
(로컬에다가 100명의 사용자가 50번씩 총 5천번을 요청한다는 뜻)
이때, 터미널안에서 아틸러리에서 median과 p95, p99가 차이가 나면 의심 해봐야함.
간단 명령어
./node_modules/artillery/bin/artillery --version
./node_modules/artillery/bin/artillery dino (공룡)
json 형식을 yaml형식으로 변환 해주는 명령어
$ npx artillery convert (artillery.json 파일명)
부하테스트 실행 명령어
$ npx artillery run (파일명)
##시나리오 작성 테스트 그래프 보여주기
실행 명령어
$ npx artillery run --output report.json (./artillery/usertest.json 파일명)
$ npx artillery report ./report.json
Report generated: <- 뜨면 밑에 명령어 사용하기
$ hax0r-report.html
______________________________________________________________________
"config": {
"target": "http://localhost:4001",
"phases": [
{
"duration": 60, //초당
"arrivalRate": 100 //요청 수
}
]
},
________________________________________________________________________
결과 보고서 읽는 법
Elapsed time: 10 seconds
Scenarios launched: 999 //인원 수
Scenarios completed: 998 //성공한 인원 수
Requests completed: 998 // 요청 건
Mean response/sec: 100 //100밀리 세컨드
Response time (msec):
min: 2 //제일 빠른 시간
max: 98 //제일 오래 걸린 시간
median: 5 // 중간 값
p95: 10 //하위 뒤에서 5번째로 느린 것.
p99: 25.5 // 하위 1% 애들
Codes:
200: 998 // 코드 200: 성공한 998'Node.js' 카테고리의 다른 글
email로 정보 보내기 (0) 2021.12.22 항해 99 주특기(node.js) (0) 2021.06.26