운영 대시보드에 DB 파일 용량 표시 #55

Closed
opened 2026-04-23 03:04:45 +09:00 by xhh · 0 comments
Owner

운영 관점에서 SQLite 파일이 얼마나 커졌는지 한눈에 보고 싶음. 현재는 컨테이너 ssh 들어가서 ls -lh data/ 해야 알 수 있다.

제안

API 쪽

/api/meta/coverage 응답에 db_size_bytes 필드 추가. 또는 /api/health 에 끼워넣기. 두 후보 중:

  • meta/coverage 권장: 운영/모니터링 정보로 묶는 게 자연스러움. 이미 테이블별 행수 등을 돌려주고 있음.
  • health 는 헬스체크 용도라 최소 페이로드 유지하는 게 좋음.
# routers/system.py::meta_coverage
db_path = get_database().engine.url.database
db_size_bytes = Path(db_path).stat().st_size if db_path and Path(db_path).exists() else None

Streamlit 쪽

Data Coverage 페이지 상단 메트릭 카드에 DB 파일 용량 추가. humanize 같은 라이브러리 없이 간단히 MB/GB 로 포맷:

st.metric("DB 파일 용량", f"{size_bytes / 1024**2:.1f} MB")

Or 사이드바에 전역 표시.

완료 기준

  • /api/meta/coverage 응답에 db_size_bytes 필드 (nullable)
  • 스키마 CoverageResponse 업데이트
  • Data Coverage 페이지에 용량 표시 (MB/GB 자동 단위)
  • 회귀 테스트 (파일 없거나 in-memory 엔진일 때 None 반환 확인)

규모

작음 (~30분).

운영 관점에서 SQLite 파일이 얼마나 커졌는지 한눈에 보고 싶음. 현재는 컨테이너 ssh 들어가서 `ls -lh data/` 해야 알 수 있다. ## 제안 ### API 쪽 `/api/meta/coverage` 응답에 `db_size_bytes` 필드 추가. 또는 `/api/health` 에 끼워넣기. 두 후보 중: - **meta/coverage 권장**: 운영/모니터링 정보로 묶는 게 자연스러움. 이미 테이블별 행수 등을 돌려주고 있음. - health 는 헬스체크 용도라 최소 페이로드 유지하는 게 좋음. ```python # routers/system.py::meta_coverage db_path = get_database().engine.url.database db_size_bytes = Path(db_path).stat().st_size if db_path and Path(db_path).exists() else None ``` ### Streamlit 쪽 `Data Coverage` 페이지 상단 메트릭 카드에 `DB 파일 용량` 추가. `humanize` 같은 라이브러리 없이 간단히 MB/GB 로 포맷: ```python st.metric("DB 파일 용량", f"{size_bytes / 1024**2:.1f} MB") ``` Or 사이드바에 전역 표시. ## 완료 기준 - [ ] `/api/meta/coverage` 응답에 `db_size_bytes` 필드 (nullable) - [ ] 스키마 `CoverageResponse` 업데이트 - [ ] `Data Coverage` 페이지에 용량 표시 (MB/GB 자동 단위) - [ ] 회귀 테스트 (파일 없거나 in-memory 엔진일 때 None 반환 확인) ## 규모 작음 (~30분).
xhh closed this issue 2026-04-26 13:33:14 +09:00
xhh referenced this issue from a commit 2026-04-26 14:41:43 +09:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
xhh/financial-data-platform#55
No description provided.