Skip to content

Fix: 토큰 파싱 수정 - #112

Merged
jaebeom79 merged 1 commit into
mainfrom
develop
May 30, 2026
Merged

Fix: 토큰 파싱 수정#112
jaebeom79 merged 1 commit into
mainfrom
develop

Conversation

@jaebeom79

Copy link
Copy Markdown
Contributor

📢 기능 설명

필요시 실행결과 스크린샷 첨부

연결된 issue

연결된 issue를 자동을 닫기 위해 아래 {이슈넘버}를 입력해주세요.

close #{이슈넘버}

✅ 체크리스트

  • PR 제목 규칙 잘 지켰는가?
  • 추가/수정사항을 설명하였는가?
  • 이슈넘버를 적었는가?

@jaebeom79
jaebeom79 merged commit 9b26106 into main May 30, 2026
1 check passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates k6/11-vacancy-test.js to parse REMAIN_ID as an integer in a POST request payload and replaces performance.now() with Date.now() to accommodate the k6 v2 runtime. The reviewer pointed out that REMAIN_ID is already parsed as a number during initialization, making the inline parseInt redundant and inefficient inside the performance-critical subscribe function, and suggested reverting this change.

Comment thread k6/11-vacancy-test.js
const res = http.post(
`${BASE_URL}/api/v1/vacancy`,
JSON.stringify({ remainId: REMAIN_ID }),
JSON.stringify({ remainId: parseInt(REMAIN_ID, 10) }),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

⚠️ 중복 타입 변환 및 성능 개선 필요

REMAIN_ID는 이미 파일 상단(159번 라인)에서 Number(__ENV.REMAIN_ID || 0)를 통해 숫자 타입으로 변환되어 정의되어 있습니다.

또한, subscribe() 함수는 부하 테스트 실행 시 반복적으로 호출되는 핵심 루프(Hot Path)입니다. 매 요청마다 parseInt를 호출하는 것은 불필요한 오버헤드를 발생시킵니다.

만약 정수 파싱이 반드시 필요하다면, 매 요청마다 변환하는 대신 159번 라인의 초기화 시점에서 parseInt를 수행하고, 여기서는 이미 변환된 REMAIN_ID 상수를 그대로 사용하는 것이 성능과 가독성 측면에서 훨씬 효율적입니다.

Suggested change
JSON.stringify({ remainId: parseInt(REMAIN_ID, 10) }),
JSON.stringify({ remainId: REMAIN_ID }),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant