-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_progress.sh
More file actions
executable file
·66 lines (55 loc) · 1.71 KB
/
check_progress.sh
File metadata and controls
executable file
·66 lines (55 loc) · 1.71 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
#!/bin/bash
# Quick progress check for LCL ingestion
cd /Users/vatsalmehta/Developer/FYP-Predictive_Anomaly_Detection
clear
echo "=========================================="
echo "LCL INGESTION PROGRESS"
echo "=========================================="
echo ""
# Check if running
if pgrep -f "python.*lcl" > /dev/null 2>&1; then
echo "Status: ✅ RUNNING"
else
echo "Status: ⏹️ STOPPED/COMPLETED"
fi
echo ""
echo "Latest progress:"
tail -3 lcl_ingestion.log 2>/dev/null || echo "No log yet"
echo ""
poetry run python << 'EOF'
import polars as pl
from pathlib import Path
import datetime
lcl_dir = Path("data/processed/lcl_data")
if lcl_dir.exists() and list(lcl_dir.glob("*.parquet")):
files = list(lcl_dir.glob("*.parquet"))
df = pl.scan_parquet(str(lcl_dir / "*.parquet"))
total = df.select(pl.len()).collect().item()
# Get log count
with open("lcl_ingestion.log") as f:
for line in reversed(f.readlines()):
if "Processed" in line:
try:
processed = int(line.split("Processed ")[1].split(" ")[0])
break
except:
pass
progress = (processed / 167_932_474) * 100
ratio = total / processed
print(f"Files: {len(files):,}")
print(f"Log: {processed:,} ({progress:.1f}%)")
print(f"Disk: {total:,}")
print(f"Match: {ratio:.6f}x", end=" ")
if 0.999 < ratio < 1.001:
print("✅")
else:
print(f"⚠️")
else:
print("No data yet...")
EOF
echo ""
echo "=========================================="
echo "Commands:"
echo " Watch live: tail -f lcl_ingestion.log"
echo " This script: ./check_progress.sh"
echo "=========================================="