Skip to content

Sabermetrics Sync Scheduler and Documentation #174

@grovecj

Description

@grovecj

Overview

Add scheduled jobs for sabermetrics and OAA data sync, plus documentation for gWAR methodology.

Parent Issue

Part of #94 (WAR and Advanced Stats)

Scheduler Jobs

Daily Sabermetrics Sync

@Scheduled(cron = "0 30 6 * * *")  // 6:30 AM daily
public void dailySabermetricsSync() {
    // Run after basic stats sync (6 AM)
    sabermetricsIngestionService.syncAllPlayerSabermetrics(season);
}

Weekly OAA Sync

@Scheduled(cron = "0 0 7 * * SUN")  // Sunday 7 AM
public void weeklyOaaSync() {
    // OAA updates less frequently
    oaaIngestionService.syncOaaForSeason(season);
}

Files to Modify

ingestion/scheduler/IngestionScheduler.java

Add scheduled methods for:

  • Daily sabermetrics sync
  • Weekly OAA sync

ingestion/service/IngestionOrchestrator.java

Add tracked sync methods:

  • runTrackedSabermetricsSync()
  • runTrackedOaaSync()

Documentation

docs/GWAR_METHODOLOGY.md

Document:

  1. gWAR formula and components
  2. Data sources (MLB API, Baseball Savant)
  3. Comparison to fWAR/bWAR
  4. Limitations and caveats
  5. Update frequency

API Documentation

Update Swagger/OpenAPI annotations with:

  • gWAR endpoint descriptions
  • Component explanations
  • Links to methodology doc

Admin UI

Add to admin panel:

  • Manual trigger for sabermetrics sync
  • Manual trigger for OAA sync
  • Display last sync timestamps

Acceptance Criteria

  • Scheduler jobs configured and tested
  • Jobs can be triggered manually via admin
  • GWAR_METHODOLOGY.md created
  • Swagger docs updated
  • Sync progress tracked in sync_jobs table

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions