snp-connection-monitoring/frontend/src/services/dashboardService.ts
HYOJIN c330be5a52 feat(phase5): 대시보드 + 통계 + Service Status 페이지
백엔드:
- DashboardService/Controller (요약, 시간별/서비스별/테넌트별 통계, 에러율, 상위API, 최근로그)
- 헬스체크 1분 간격, 매 체크마다 로그 기록 (status page용)
- ServiceStatusDetail API (90일 일별 uptime, 최근 체크 60건)
- 통계 쿼리 최적화 인덱스 추가
- 테넌트별 요청/사용자 비율 API
- 상위 API에 serviceName + apiName 표시

프론트엔드:
- DashboardPage (요약 카드 4개, 하트비트 바, Recharts 차트 4개, 테넌트 차트 2개, 최근 로그 5건+더보기)
- ServiceStatusPage (status.claude.com 스타일, 90일 uptime 바, Overall banner)
- ServiceStatusDetailPage (서비스별 상세, 일별 uptime 바+툴팁, 최근 체크 테이블, 색상 범례)
- 30초 자동 갱신 (대시보드), 60초 자동 갱신 (status)
- Request Logs 배지 색상 대시보드와 통일

Closes #10

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 13:44:23 +09:00

15 lines
1.0 KiB
TypeScript

import { get } from './apiClient';
import type { DashboardStats, HourlyTrend, ServiceRatio, ErrorTrend, TopApi, TenantRatio } from '../types/dashboard';
import type { RequestLog } from '../types/monitoring';
import type { HeartbeatStatus } from '../types/service';
export const getSummary = () => get<DashboardStats>('/dashboard/summary');
export const getHourlyTrend = () => get<HourlyTrend[]>('/dashboard/hourly-trend');
export const getServiceRatio = () => get<ServiceRatio[]>('/dashboard/service-ratio');
export const getErrorTrend = () => get<ErrorTrend[]>('/dashboard/error-trend');
export const getTopApis = (limit = 10) => get<TopApi[]>(`/dashboard/top-apis?limit=${limit}`);
export const getTenantRequestRatio = () => get<TenantRatio[]>('/dashboard/tenant-request-ratio');
export const getTenantUserRatio = () => get<TenantRatio[]>('/dashboard/tenant-user-ratio');
export const getRecentLogs = () => get<RequestLog[]>('/dashboard/recent-logs');
export const getHeartbeat = () => get<HeartbeatStatus[]>('/dashboard/heartbeat');