-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackfill-progress.ps1
More file actions
80 lines (68 loc) · 2.35 KB
/
backfill-progress.ps1
File metadata and controls
80 lines (68 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# backfill-progress.ps1 - Monitor backfill processing progress
Write-Host "📊 OpenFront Backfill Progress Report" -ForegroundColor Cyan
Write-Host "=" * 50
# Get lobby processing status
$statusQuery = @"
SELECT
status,
COUNT(*) as count,
ROUND(100.0 * COUNT(*) / SUM(COUNT(*)) OVER (), 1) as percentage
FROM unique_lobbies
WHERE game_mode = 'Free For All'
GROUP BY status
ORDER BY count DESC;
"@
Write-Host "`n🎮 FFA Lobby Processing Status:" -ForegroundColor Yellow
docker-compose exec -T postgres psql -U scraper -d openfront -c $statusQuery
# Get processing progress over time
$progressQuery = @"
SELECT
DATE(processed_at) as date,
COUNT(*) as games_processed
FROM game_data
GROUP BY DATE(processed_at)
ORDER BY date DESC
LIMIT 7;
"@
Write-Host "`n📈 Recent Processing Activity:" -ForegroundColor Yellow
docker-compose exec -T postgres psql -U scraper -d openfront -c $progressQuery
# Get duration statistics
$durationQuery = @"
SELECT
COUNT(*) as total_games,
ROUND(AVG(duration_minutes), 1) as avg_duration_mins,
MIN(duration_minutes) as min_duration_mins,
MAX(duration_minutes) as max_duration_mins,
ROUND(STDDEV(duration_minutes), 1) as stddev_mins
FROM game_data
WHERE duration_minutes IS NOT NULL;
"@
Write-Host "`n⏱️ Game Duration Statistics:" -ForegroundColor Yellow
docker-compose exec -T postgres psql -U scraper -d openfront -c $durationQuery
# Get top maps by game count
$mapsQuery = @"
SELECT
game_map,
COUNT(*) as games_played,
ROUND(AVG(duration_minutes), 1) as avg_duration
FROM game_data
WHERE game_map IS NOT NULL
GROUP BY game_map
ORDER BY games_played DESC
LIMIT 10;
"@
Write-Host "`n🗺️ Top Maps (by games played):" -ForegroundColor Yellow
docker-compose exec -T postgres psql -U scraper -d openfront -c $mapsQuery
# Current processing queue
$queueQuery = @"
SELECT
COUNT(*) FILTER (WHERE status = 'backfill_ready') as backfill_ready,
COUNT(*) FILTER (WHERE status = 'new') as new_ready,
COUNT(*) FILTER (WHERE status = 'api_completed') as ready_for_processing,
COUNT(*) FILTER (WHERE status = 'retrying') as retrying
FROM unique_lobbies
WHERE game_mode = 'Free For All';
"@
Write-Host "`n🔄 Current Processing Queue:" -ForegroundColor Yellow
docker-compose exec -T postgres psql -U scraper -d openfront -c $queueQuery
Write-Host "`n✅ Report Complete" -ForegroundColor Green