From 447d6b8e5d25bc204c1755a6a4f1c61685a0b384 Mon Sep 17 00:00:00 2001 From: Hyowon Yang Date: Thu, 23 Oct 2025 16:06:01 +0900 Subject: [PATCH] =?UTF-8?q?analytics-=EB=A7=81=EA=B3=A0=EB=B9=84=EC=A6=88?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 대시보드 조회 내부 시퀀스에 링고비즈 API 호출 추가 - 병렬 API 호출에 링고비즈 추가 (CompletableFuture 4개로 확장) - Circuit Breaker 및 Fallback 전략 적용 - 데이터 통합 섹션에 링고비즈 통화 완료 수 포함 --- .../inner/analytics-대시보드조회.puml | 42 +++++++++++++++++-- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/design/backend/sequence/inner/analytics-대시보드조회.puml b/design/backend/sequence/inner/analytics-대시보드조회.puml index bdfd31e..785eaa7 100644 --- a/design/backend/sequence/inner/analytics-대시보드조회.puml +++ b/design/backend/sequence/inner/analytics-대시보드조회.puml @@ -117,8 +117,8 @@ else Cache MISS note right of Service **병렬 처리 시작** - - CompletableFuture 3개 생성 - - 우리동네TV, 지니TV, SNS APIs 동시 호출 + - CompletableFuture 4개 생성 + - 우리동네TV, 지니TV, 링고비즈, SNS APIs 동시 호출 - Circuit Breaker 적용 (채널별 독립) end note @@ -188,6 +188,41 @@ else Cache MISS deactivate ChannelService end + else + + Service -> ChannelService: getRingoBizStats(eventId) + activate ChannelService + + ChannelService -> CB: execute("ringoBiz", () -> callAPI()) + activate CB + + note right of CB + **Circuit Breaker** + - State: CLOSED (정상) + - Failure Rate: 50% 초과 시 OPEN + - Timeout: 10초 + end note + + CB -> CB: 외부 API 호출\nGET /voice-stats/{eventId} + + alt 정상 응답 + CB --> ChannelService: ChannelStats\n- calls: 3000\n- completed: 2500\n- avgDuration: 45초 + deactivate CB + ChannelService --> Service: RingoBizStats + deactivate ChannelService + else Timeout 또는 장애 + CB -> CB: **Fallback 실행**\n기본값 반환 + note right of CB + 링고비즈 API 장애: + - 기본값 (0) 반환 + - 알림: "링고비즈 데이터 로딩 실패" + end note + CB --> ChannelService: 기본값 (0) + deactivate CB + ChannelService --> Service: RingoBizStats (기본값) + deactivate ChannelService + end + else Service -> ChannelService: getSNSStats(eventId) @@ -229,13 +264,14 @@ else Cache MISS ||| == 3. 데이터 통합 및 ROI 계산 == - Service -> Service: mergeChannelStats(\n wooriTV, genieTV, sns\n) + Service -> Service: mergeChannelStats(\n wooriTV, genieTV, ringoBiz, sns\n) note right of Service **데이터 통합** - 총 노출 수 = 외부 채널 노출 합계 - 총 참여자 수 = Analytics DB - 채널별 전환율 = 참여자 수 / 노출 수 + - 링고비즈: 통화 완료 수 포함 end note Service -> Calculator: calculateROI(\n eventStats, channelStats\n)