Skip to content

Jmeter 부하 테스트에 필요한 코드 수정 #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

jia8883
Copy link
Collaborator

@jia8883 jia8883 commented May 20, 2025

closes #31

다음의 시나리오에 따라 필요한 코드를 일부 수정했습니다. 예를 들어 슬랙 인증 로직을 우회한다던지, open ai 의 유료문제를 피하기 위해 mock 객체를 만든다던지요.

image

@jia8883 jia8883 requested a review from heeve1 May 20, 2025 13:20
@jia8883 jia8883 self-assigned this May 20, 2025
@jia8883 jia8883 linked an issue May 20, 2025 that may be closed by this pull request
Copy link
Collaborator

@heeve1 heeve1 left a comment

Choose a reason for hiding this comment

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

아마 부하테스트 결과 레포트는 별도로 전달해주시겠지요? 고생하셨습니다.

* - 요약 및 피드백을 추출하여 SummaryResult 객체로 반환
*/
@Component
@Profile("!mock-openai")
Copy link
Collaborator

Choose a reason for hiding this comment

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

profile은 일반적으로 dev, staging, prod 등 환경 구분 목적으로 사용되며, 그 외의 값을 무분별하게 사용하면 점차 관리가 어려워질 수 있습니다. 만약 특수한 목적에 따라 별도의 프로파일을 활용해야 한다면, 명확한 문서화를 통해 팀원 간 혼란이 없도록 주의 깊게 관리하는 것이 중요합니다~

Comment on lines +102 to +107
} catch (WebClientException e) {
log.error("WebClient 오류로 OpenAI API 호출 실패", e);
throw new OpenAIClientException("WebClient 오류로 OpenAI API 호출 실패", e);
} catch (Exception e) {
log.error("OpenAIClient 내부 처리 중 알 수 없는 예외 발생 - 요청 프롬프트 처리 또는 응답 파싱 과정 문제일 수 있음", e);
throw new OpenAIClientException("알 수 없는 오류로 OpenAI 호출 실패", e);
Copy link
Collaborator

Choose a reason for hiding this comment

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

보다 명확한 예외로 변환해 던지는 것은 아주 좋은 개선 시도입니다. 예외의 의미를 분명히 전달할 수 있어, 문제 원인 파악과 후속 처리에 큰 도움이 됩니다. 👍

Base automatically changed from feature/29 to main May 21, 2025 12:32
jia8883 added 5 commits May 21, 2025 21:33
- jmeter에서 부하 테스트의 몇 시나리오 중에서 슬랙에서 사용자가 학습 로그 메시지를 보낼때, 슬랙 인증 로직을 피할 수 있게 하고 싶었습니다. jmeter에서의 하드코딩을 피하고 싶었기 때문입니다.
- 부하테스트 시나리오 중에 open ai 를 호출하는 부분이 있습니다. 과금을 피하기 위해 프로파일 설정, 인터페이스 생성을 했습니다. 또한 Jmeter에서 DailySummaryScheduler을 트리거할 수 없으니 스케줄러를 트리거하기 위해 TestSchedulerController를 만들어서 수동으로 엔드포인트를 노출시켰습니다.
- prod 프로파일의 경우에 보다 안전하게 운영되도록 yml에 설정을 추가합니다. 즉 운영 환경에서는 우회하지 않고 슬랙 인증을 진짜로 하도록 보장합니다.
- 애플리케이션 실행할때마다 재시도 큐에 빠져서 너무 많이 콘솔에 로그가 생깁니다. 재시도 큐가 실행되지 않도록 개발환경에서 시나리오4는 주석처리 하겠습니다
- grafana 설치와 직접적인 관련은 없지만, web과 webflux의 조합이 불안정하고 충돌이 많을 수 있다길래 의존성을 수정했습니다. 즉 boot-starter-webflux를 지우고, implementation 'org.springframework:spring-webflux'을 넣었습니다.
@jia8883
Copy link
Collaborator Author

jia8883 commented May 21, 2025

report-sc1.zip
report-sc2.zip
report-sc3.zip
report-sc4.zip
이렇게 압축파일로 올리면 html 리포트로 테스트 결과를 보실 수 있을 것 같습니다!

jia8883 added 2 commits May 25, 2025 22:17
- 실제 Slack에 메시지 전송을 하려니 운영 장애가 발생했습니다. 실제로 부하를 하고 성능을 알기 위해 Slack을 우회하고자 했습니다.
- Grafana의 DB Connection Pool 패널을 만들기 위해 설정을 수정했습니다.
@jia8883 jia8883 requested a review from heeve1 May 25, 2025 13:20
jia8883 added 13 commits May 26, 2025 13:04
문제상황 : jmeter의 부하테스트를 하는 과정 중 슬랙에 요약 메시지를 전달하는 과정에 운영장애가 나서 성능 테스트를 못했습니다. 따라서 Slack 우회 조건을 달았는데 여기서 테스트 문제가 생겼습니다. 이 문제를 디버깅하고자 합니다.

수정사항

1. 기존의 가독성 해결 : disabled라는 이중부정 논리가 사라져서 가독성이 나아집니다.

2. 서비스 코드에서는 비동기 처리로, 테스트 코드에서는 동기 처리로 수정

3. 테스트코드에서는 setter 메서드로 슬랙 우회 조건을 구현

4. ci.yml 수정 : 앞으로 6시간까지 안가고 10분을 초과하면 문제가 되도록 타임아웃 제한을 정했습니다.
현재 aws에 서버가 올라가지만 시나리오 2, 3에서 thread group이 계속 실패해서 디버깅 중입니다.
- 코드 깔끔히 정리하기
Copy link

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.

부하테스트 실행
2 participants