Skip to content

[Feat] RAGOps Dashboard 집계 지표 조회 API - #136

Merged
kangcheolung merged 7 commits into
developfrom
feature/134
Aug 10, 2026
Merged

[Feat] RAGOps Dashboard 집계 지표 조회 API#136
kangcheolung merged 7 commits into
developfrom
feature/134

Conversation

@kangcheolung

@kangcheolung kangcheolung commented Aug 10, 2026

Copy link
Copy Markdown
Member

Summary

  • GET /admin/dashboard/summary 추가 — 문서/인덱싱 작업/Worker/검색 현황을 하나의 응답으로 집계
  • DocumentRepository/EmbeddingJobRepository/SearchQueryRepository에 읽기 전용 집계 쿼리 추가 (A 담당자 소유 테이블에 쓰기 없음)
  • Worker 현황은 WorkerNodeQueryService.getWorkers()를 재사용해 Heartbeat 기반 상태 계산 로직을 중복 구현하지 않음
  • avgProcessMs는 Queue 대기 시간(created_at)을 제외한 순수 처리 시간(started_at~completed_at)만 반영

Test plan

  • DashboardQueryServiceTest 단위 테스트 3건 통과 (지표 조합, avgProcessMs null 처리, Worker active count 필터링)
  • EmbeddingJobDashboardRepositoryTest PostgreSQL @DataJpaTest 3건 통과 (평균 처리시간 Native Query 검증)
  • ./gradlew build -x test 클린 빌드 통과
  • ./gradlew test 전체 회귀 테스트 통과 — 총 726개, failures 0, errors 0, skipped 0

상세 설계

docs/design/kangcheolung-#134-ragops-dashboard-summary.md

closes #134

🤖 Generated with Claude Code

kangcheolung and others added 6 commits August 10, 2026 16:26
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kangcheolung, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9d0a6e97-a28a-4796-b188-7abd1eb100fd

📥 Commits

Reviewing files that changed from the base of the PR and between 4d8e777 and f57978b.

📒 Files selected for processing (6)
  • src/main/java/com/opensource/docgrid/domain/dashboard/controller/DashboardController.java
  • src/main/java/com/opensource/docgrid/domain/dashboard/dto/response/DashboardSummaryResponse.java
  • src/main/java/com/opensource/docgrid/domain/dashboard/dto/response/DocumentsSummaryResponse.java
  • src/main/java/com/opensource/docgrid/domain/dashboard/dto/response/JobsSummaryResponse.java
  • src/main/java/com/opensource/docgrid/domain/dashboard/dto/response/SearchSummaryResponse.java
  • src/main/java/com/opensource/docgrid/domain/dashboard/dto/response/WorkersSummaryResponse.java
📝 Walkthrough

Walkthrough

관리자용 GET /admin/dashboard/summary API를 추가했다. 문서, Embedding Job, Worker, 최근 24시간 검색 수를 조회한다. 집계 결과를 단일 응답으로 반환한다. 서비스 단위 테스트와 PostgreSQL Repository 통합 테스트를 추가했다.

Changes

RAGOps 대시보드 집계

Layer / File(s) Summary
요약 응답과 관리자 API 계약
docs/design/..., src/main/java/com/opensource/docgrid/domain/dashboard/..., src/main/java/com/opensource/docgrid/global/config/SecurityConfig.java
네 가지 요약 DTO와 GET /admin/dashboard/summary 엔드포인트를 추가했다. 성공 및 403 응답 문서를 정의했다.
집계 서비스와 저장소 조회
src/main/java/com/opensource/docgrid/domain/dashboard/service/query/DashboardQueryService.java, src/main/java/com/opensource/docgrid/domain/{document,embedding,search}/repository/*
문서·작업·Worker·검색 지표를 저장소에서 조회한다. Clock 기준 최근 24시간 검색 수를 계산한다. 완료 작업의 평균 처리 시간이 없으면 null을 반환한다.
집계 결과 검증
src/test/java/com/opensource/docgrid/domain/dashboard/..., src/test/java/com/opensource/docgrid/domain/embedding/repository/EmbeddingJobDashboardRepositoryTest.java
정상 집계, 평균 처리 시간 null, 비활성 Worker 제외를 단위 테스트로 검증한다. PostgreSQL에서 처리 시간 평균 쿼리와 테스트 데이터를 검증한다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  actor 관리자
  participant DashboardController
  participant DashboardQueryService
  participant Repositories
  participant WorkerNodeQueryService
  participant Clock

  관리자->>DashboardController: GET /admin/dashboard/summary
  DashboardController->>DashboardQueryService: getSummary()
  DashboardQueryService->>Repositories: 문서·작업·검색 집계 조회
  DashboardQueryService->>WorkerNodeQueryService: Worker 상태 조회
  DashboardQueryService->>Clock: 현재 시각 조회
  DashboardQueryService-->>DashboardController: DashboardSummaryResponse
  DashboardController-->>관리자: ApiResponse
Loading

Possibly related PRs

  • DocGrid/backend#13: /admin/** 권한 정책과 직접 연결된다.
  • DocGrid/backend#49: Embedding Job 상태 집계와 Worker 상태 데이터를 재사용한다.
  • DocGrid/backend#121: EmbeddingJobRepository 기반의 읽기 전용 대시보드 집계와 직접 관련된다.

Suggested labels: ✨ Feature

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 41.94% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed 직접 연결된 이슈 #134의 API, ADMIN 접근 제어, 4개 지표 집계, 읽기 전용 쿼리, 처리 시간 계산 요구를 충족합니다.
Out of Scope Changes check ✅ Passed 설계 문서, 대시보드 구현, 집계 쿼리, 테스트와 보안 주석 변경은 모두 이슈 #134의 범위에 포함됩니다.
Title check ✅ Passed 제목이 RAGOps Dashboard 집계 지표 조회 API 추가라는 핵심 변경을 간결하고 명확하게 설명합니다.
Description check ✅ Passed 요약, 상세 설계, 테스트 계획, 이슈 연결을 포함해 주요 변경과 검증 정보를 충분히 설명합니다.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/134

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kangcheolung kangcheolung changed the title [Feature] RAGOps Dashboard 집계 지표 조회 API [Feat] RAGOps Dashboard 집계 지표 조회 API Aug 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/main/java/com/opensource/docgrid/domain/dashboard/controller/DashboardController.java`:
- Around line 30-34: Update the DashboardController OpenAPI description to
remove the claim that status changes are delivered via WebSocket push, and state
that the endpoint returns metrics as a snapshot captured at request time only.

In
`@src/main/java/com/opensource/docgrid/domain/dashboard/dto/response/DashboardSummaryResponse.java`:
- Around line 5-18: 클래스 수준 주석을 추가하십시오.
src/main/java/com/opensource/docgrid/domain/dashboard/dto/response/DashboardSummaryResponse.java:5-18에는
대시보드 스냅샷의 최상위 응답 DTO로서 하위 요약을 조합하는 경계를 설명하고,
src/main/java/com/opensource/docgrid/domain/dashboard/controller/DashboardController.java:22-28에는
관리자 대시보드 조회 HTTP 경계이며 집계를 DashboardQueryService에 위임한다는 책임을 설명하십시오.

In
`@src/main/java/com/opensource/docgrid/domain/dashboard/dto/response/DocumentsSummaryResponse.java`:
- Around line 5-15: 문서 집계 응답의 역할과 포함 범위를 설명하는 클래스 수준 Javadoc을
DocumentsSummaryResponse에 추가하세요.
src/main/java/com/opensource/docgrid/domain/dashboard/dto/response/DocumentsSummaryResponse.java
5-15에는 문서 집계 책임과 외부 응답 DTO 경계를,
src/main/java/com/opensource/docgrid/domain/dashboard/dto/response/JobsSummaryResponse.java
5-19에는 Job 상태 및 평균 처리 시간 집계 책임을,
src/main/java/com/opensource/docgrid/domain/dashboard/dto/response/SearchSummaryResponse.java
5-9에는 최근 검색 집계 책임을,
src/main/java/com/opensource/docgrid/domain/dashboard/dto/response/WorkersSummaryResponse.java
5-12에는 Worker 상태 집계 책임을 각각 설명하는 Javadoc을 record 선언부에 추가하세요.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 79801fa6-93ae-4d6f-b94f-f6ec8d80487e

📥 Commits

Reviewing files that changed from the base of the PR and between 1ea8376 and 4d8e777.

📒 Files selected for processing (14)
  • docs/design/kangcheolung-#134-ragops-dashboard-summary.md
  • src/main/java/com/opensource/docgrid/domain/dashboard/controller/DashboardController.java
  • src/main/java/com/opensource/docgrid/domain/dashboard/dto/response/DashboardSummaryResponse.java
  • src/main/java/com/opensource/docgrid/domain/dashboard/dto/response/DocumentsSummaryResponse.java
  • src/main/java/com/opensource/docgrid/domain/dashboard/dto/response/JobsSummaryResponse.java
  • src/main/java/com/opensource/docgrid/domain/dashboard/dto/response/SearchSummaryResponse.java
  • src/main/java/com/opensource/docgrid/domain/dashboard/dto/response/WorkersSummaryResponse.java
  • src/main/java/com/opensource/docgrid/domain/dashboard/service/query/DashboardQueryService.java
  • src/main/java/com/opensource/docgrid/domain/document/repository/DocumentRepository.java
  • src/main/java/com/opensource/docgrid/domain/embedding/repository/EmbeddingJobRepository.java
  • src/main/java/com/opensource/docgrid/domain/search/repository/SearchQueryRepository.java
  • src/main/java/com/opensource/docgrid/global/config/SecurityConfig.java
  • src/test/java/com/opensource/docgrid/domain/dashboard/service/query/DashboardQueryServiceTest.java
  • src/test/java/com/opensource/docgrid/domain/embedding/repository/EmbeddingJobDashboardRepositoryTest.java

@kangcheolung
kangcheolung merged commit 2b1483f into develop Aug 10, 2026
1 check passed
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.

[Feat] RAGOps Dashboard 집계 지표 조회 API

1 participant