- Updated logging setup to include a console formatter for concise output.
- Added detailed metrics for various dungeon modes (COOP, Solo, Survival, etc.) including entry counts, first results, escape counts, average survival times, and more.
- Improved retention analysis with additional checks for D2 to D6 retention.
- Enhanced progress logging during data collection and batch processing for better visibility.
- Updated result writing to include new metrics and adjusted headers accordingly.
- Refined retention funnel analysis to provide detailed insights into user retention rates across different days.
1. create_uid 기준 전체 코호트 포함
- create_uid에서 식별된 모든 신규 유저(126,666명)를 코호트에 포함
- 계정만 생성하고 이탈한 유저도 분석 대상에 포함
2. log_return_to_lobby 차선책 로직 추가
- login_comp에서 데이터를 수집하지 못한 유저들에 대해
- log_return_to_lobby 인덱스에서 body.nickname 수집
- 우선순위: login_comp → log_return_to_lobby
3. 성능 최적화 설정 업데이트
- DEFAULT_BATCH_SIZE: 500 → 2000 (4배 증가)
- DEFAULT_MAX_WORKERS: 6 → 16 (2.7배 증가)
- DEFAULT_COMPOSITE_SIZE: 500 → 2000 (4배 증가)
🔍 변경된 처리 로직
1. Step 1: create_uid에서 신규 유저 식별 (기존과 동일)
2. Step 2: heartbeat에서 auth.id 수집 (기존과 동일)
3. Step 3: 모든 create_uid 유저를 코호트에 우선 추가
4. Step 4: login_comp에서 추가 정보 수집 (1차 우선)
5. Step 5: log_return_to_lobby에서 차선 정보 수집
이제 누락 없이 모든 신규 유저가 분석 대상에 포함되며, 처리 속도도 크게 향상될 것입니다.
1. first_login_time 필드 제거 및 create_time으로 통합
- get_new_user_cohort_optimized 함수에서 first_login_* 필드들을 제거하고 create_time_*으로 통합
- build_fixed_msearch_queries와 calculate_comprehensive_session_metrics에서 first_login_dt를 create_time_dt로 변경
- CSV 헤더에서 first_login_time 제거
2. auth.id 수집 로직 수정
- create_uid 인덱스에서 auth.id를 정확히 수집하여 new_user_map에 저장
- result 딕셔너리 생성 시 auth_id 필드에 기본값 처리 추가
3. retention_status 판정을 create_time 기준으로 변경
- 모든 시간 범위 계산을 create_time_dt 기준으로 변경
- D+0, D+1 판정이 계정 생성 시점 기준으로 작동
4. 세션 관련 지표를 --full 옵션으로 조건부 실행
- --full 명령줄 옵션 추가
- process_fixed_batch 함수에 include_session_metrics 파라미터 추가
- --full 옵션이 없으면 active_seconds, total_playtime_minutes, session_count, avg_session_length을 0으로 설정하여 빠른
실행 가능
이제 스크립트는 다음과 같이 실행할 수 있습니다:
- 빠른 분석: python ds_new_user_analy.py --start-time "2025-08-16T12:00:00+09:00" --end-time "2025-08-16T14:00:00+09:00"
- 전체 분석: python ds_new_user_analy.py --start-time "2025-08-16T12:00:00+09:00" --end-time "2025-08-16T14:00:00+09:00"
--full
수정이 완료되었습니다. 이제 get_new_user_cohort_optimized 함수는:
1. Step 1: create_uid 인덱스에서 신규 유저와 계정 생성 시간 수집 (auth.id는 빈값이므로 수집하지 않음)
2. Step 2: heartbeat 인덱스에서 각 UID에 대한 auth.id 수집
3. Step 3: login_comp 인덱스에서 추가 정보(닉네임, 언어, 디바이스) 수집