Repository navigation
perf: 사용자 Pod 상태를 5분마다 한 번에 읽어 두고 관리자 컨테이너 목록에 붙임 - #717
Merged
Merged
Conversation
- 멈춘 컨테이너 감시 작업이 매 바퀴 사용자 Pod 목록을 한 번 읽어 메모리 캐시(PodStatusCache)에 넣는다 - GET /api/admin/requests/containers가 캐시의 Pod 상태·읽은 시각(statusCheckedAt)·신청 상태를 함께 준다 - POST /api/admin/pods/status-refresh로 즉시 다시 읽는다(10초 안의 재요청은 직전 값) - k8s가 원본이라 DB에는 남기지 않는다. 읽기에 실패하면 이전 값과 그 시각을 그대로 둔다 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
배경
관리자 화면은 컨테이너 목록을 열 때마다 컨테이너 수 × 2번(Pod 상세·진행 상태) k8s·config-server를 불렀다. 같은 정보를 멈춘 컨테이너 감시 작업(
ContainerStopWatcher)이 5분마다 이미 읽고 있었다.변경
PodQueryService.listUserPods(): 사용자 Pod(app=ailab-guest) 전체를 한 번 읽어 상태 목록과 멈춘 Pod 목록을 함께 돌려준다(listStoppedPods대체)PodStatusCache: 마지막으로 읽은 상태와 읽은 시각을 메모리에 둔다. k8s가 원본이라 DB에는 남기지 않는다. 읽기에 실패하면 이전 값과 그 시각을 그대로 둔다ContainerStopWatcher: 매 바퀴 캐시를 갱신하고 그 결과로 멈춘 컨테이너를 알린다(5분,containers.stop-watch.poll-ms)GET /api/admin/requests/containers:pod(캐시의 Pod 상태)·statusCheckedAt·status(신청 상태)를 더한다. 이 경로는 k8s를 부르지 않는다POST /api/admin/pods/status-refresh: 즉시 다시 읽는다. 10초 안에 다시 부르면 직전 값을 돌려준다확인
PodStatusCacheTest신규 4건, 목록에 캐시 붙이기·사용자 Pod만 읽기·즉시 갱신 API 추가)짝 PR: CSID-DGU/admin_fe(목록 응답의 상태를 그대로 쓰도록)
🤖 Generated with Claude Code