Skip to content
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

[BE] feat#229 모니터링 구현 v4 #271

Merged
merged 4 commits into from
Nov 27, 2024

Conversation

DongHoonYu96
Copy link
Collaborator

@DongHoonYu96 DongHoonYu96 commented Nov 26, 2024

➕ 이슈 번호


🔎 작업 내용

이 풀 리퀘스트에는 다음과 같은 주요 변경 사항이 포함됩니다:

  • 의존성 업데이트:
    @socket.io/admin-ui 패키지를 package.json 및 package-lock.json 파일에 추가했습니다.

  • 로깅 및 모니터링 개선:
    SystemMetricsService를 도입하여 CPU 사용량, 메모리 사용량, MySQL 및 Redis 지표와 같은 시스템 지표를 수집합니다.
    SocketEventLoggerInterceptor를 업데이트하여 CPU 및 메모리 사용량, MySQL 및 Redis 지표와 같은 시스템 지표를 소켓 이벤트에 대해 기록합니다.

  • 모듈 및 인터셉터 변경사항:
    CommonModule을 생성하여 SocketEventLoggerInterceptor와 SystemMetricsService를 제공하고 내보냅니다.
    SocketEventLoggerInterceptor를 수정하여 SystemMetricsService를 사용하여 시스템 지표를 기록하도록 했습니다.

  • Socket.IO 관리 UI 통합:
    game.gateway.ts에서 Socket.IO 관리 UI를 통합하여 소켓 연결 및 이벤트를 모니터링할 수 있게 했습니다.

  • 게임 모듈 업데이트:
    GameModule의 공급자에 SocketEventLoggerInterceptor와 SystemMetricsService를 추가했습니다.


🖼 참고 이미지

image


🎯 리뷰 요구사항 (선택)

  • 특별히 봐줬으면 하는 부분이 있다면 적어주세요

✅ Check List

  • merge할 브랜치의 위치를 확인했나요?
  • Label을 지정했나요?

cpu, mem, connection 상황 출력
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 suggestions.

return {
connectedClients: connected_clients,
usedMemoryMB: Math.round(used_memory / 1024 / 1024),
clientList: String(clientList).split('\n').length,
Copy link
Preview

Copilot AI Nov 26, 2024

Choose a reason for hiding this comment

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

Using String(clientList).split('\n').length to count clients may not be accurate. Consider using a more reliable method to count the clients.

Suggested change
clientList: String(clientList).split('\n').length,
clientList: clientList.trim().split('\n').filter(line => line).length,

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
'\nRedis Connections:\n' +
`Connected Clients: ${metrics.redis.connectedClients}, ` +
`Used Memory: ${metrics.redis.usedMemoryMB}MB\n` +
`클라이언트 큐 길이: ${metrics.redis.queueLength}\n` +
Copy link
Preview

Copilot AI Nov 26, 2024

Choose a reason for hiding this comment

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

The log message should be in English for consistency. Change '클라이언트 큐 길이' to 'Client Queue Length'.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Copy link
Collaborator

@ijun17 ijun17 left a comment

Choose a reason for hiding this comment

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

오우 고생하셨습니다 LGTM~

@DongHoonYu96 DongHoonYu96 merged commit 0091444 into boostcampwm-2024:dev-be Nov 27, 2024
@DongHoonYu96 DongHoonYu96 deleted the feature-be-#229 branch November 27, 2024 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants