Skip to content

goorm-dev/ktb-stresstest

Repository files navigation

주요 기능 설명

1. 메인 엔트리 (app.js)

  • 애플리케이션 실행 시 호출되는 메인 파일
  • 주요기능:
    • Playwright를 통해 브라우저 제어
    • 부하테스트에 필요한 기능 호출
      • 서비스 모듈(auth, chat, profile, ai)에서 제공하는 기능 호출
    • 사용자 ID 및 설정을 랜덤 생성하여 테스트 환경 설정

2. 채팅 모듈 (app/chat/services.js)

  • 채팅 방과 관련된 작업을 담당
  • 주요 기능:
    • accessChat(page, chatName): 특정 채팅 방 입장
    • createChat(page, chatName): 새로운 채팅 방 생성
    • talkChat(page, text): 채팅방 대화
    • addReactions(page, findText): 특정 단어에 리액션 추가
    • scrollDown(page): 채팅 방 목록 무한 스크롤 다운
    • uploadFile(page, filename): 채팅 방 파일 업로드

3. 인증 모듈 (app/auth/services.js)

  • 계정 관리 및 로그인
  • 주요 기능:
    • addUser(page, id, passwd, email): 회원가입
    • login(page, email, passwd): 로그인
    • logout(page): 로그아웃

4. 프로필 관리 모듈 (app/profile/services.js)

  • 사용자 프로필 처리
  • 주요 기능:
    • addProfileImage(page, filename): 프로필 이미지 업로드

5. AI 모듈 (app/ai/services.js)

  • AI 시스템과의 대화
  • 주요 기능:
    • generateAiResponse(page, aiMention): AI와 대화를 시작 후 응답 생성

설치 및 실행

  1. 의존성 설치

    • Ubuntu
    npm install -g artillery@latest
    npm init playwright@latest
  2. 실행

    artillery run playwright-artillery.yml

playwright-artillery.yml 설정

  • 환경변수 설정 필요

    export BASE_URL="https://your-target-domain.com"
    export RAMP_DURATION="10s"           # 부하 증가 시간 (예: 10초)
    export RAMP_ARRIVAL_COUNT="10"       # 총 사용자 수
  • 주요 설정값 의미

    • duration: 각 단계별 테스트 지속 시간
    • arrivalCount: 해당 단계에서 생성될 총 가상 사용자 수
    • headless: true: 브라우저 UI 없이 실행 (성능상 유리)
    • flowFunction: app.js에 정의된 시나리오 함수명
  • 부하테스트 패턴 조정

    phases:
    # 방법 1: arrivalCount 사용 (총 사용자 수 기준)
    - duration: "10s"        # 10초 동안
      arrivalCount: 50       # 총 50명의 사용자 생성
    
    # 방법 2: arrivalRate 사용 (초당 사용자 수 기준)
    - duration: "10s"        # 10초 동안
      arrivalRate: 5         # 초당 5명의 사용자 생성 (총 50명)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6