-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmonitor_realtime.sh
More file actions
executable file
·98 lines (85 loc) · 3.14 KB
/
monitor_realtime.sh
File metadata and controls
executable file
·98 lines (85 loc) · 3.14 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/bash
# Real-time monitoring script for statistical benchmarks
echo "🔍 Real-time AFSysBench Statistical Monitor"
echo "=========================================="
# Function to check timing patterns
check_timing_pattern() {
if [ -f "statistical_run_full.log" ]; then
echo ""
echo "⏱️ Recent Completion Times:"
grep "✅ Completed in" statistical_run_full.log | tail -5 | while read line; do
time=$(echo "$line" | grep -o '[0-9.]*s')
test_info=$(echo "$line" | cut -d':' -f2- | cut -d'✅' -f1)
echo " $test_info: $time"
done
fi
}
# Function to monitor Docker resource usage
monitor_docker() {
if docker ps | grep -q alphafold; then
echo ""
echo "🐳 Docker Resource Usage:"
docker stats --no-stream --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}" | grep alphafold
fi
}
# Function to check expected vs actual runtime
analyze_runtime() {
if [ -f "statistical_results_20250729_052507/statistical_summary.csv" ]; then
echo ""
echo "📊 Runtime Analysis:"
python3 -c "
import csv
import statistics
try:
with open('statistical_results_20250729_052507/statistical_summary.csv', 'r') as f:
reader = csv.DictReader(f)
data = list(reader)
if data:
successful = [float(row['duration_sec']) for row in data if row['status'] == 'SUCCESS']
if successful:
mean_time = statistics.mean(successful)
print(f' Completed runs: {len(successful)}')
print(f' Average time: {mean_time:.1f}s ({mean_time/60:.1f}m)')
if mean_time > 300: # 5+ minutes
print(' ✅ Real computation detected (>5min per run)')
elif mean_time > 60: # 1+ minute
print(' ⚠️ Partial computation (1-5min per run)')
else:
print(' ❌ Only validation detected (<1min per run)')
except:
print(' No data available yet')
"
fi
}
# Main monitoring loop
while true; do
clear
echo "🔍 AFSysBench Statistical Monitor - $(date '+%H:%M:%S')"
echo "=================================================="
# Check if process is running
if pgrep -f "run_statistical_benchmarks" > /dev/null; then
echo "📊 Status: 🟢 RUNNING"
else
echo "📊 Status: 🔴 STOPPED"
break
fi
# Check Docker containers
docker_count=$(docker ps | grep -c alphafold)
echo "🐳 AlphaFold Containers: $docker_count running"
# Show current progress
if [ -f "statistical_run_full.log" ]; then
current_test=$(tail -20 statistical_run_full.log | grep "🔄 Iteration" | tail -1)
if [ -n "$current_test" ]; then
echo "🔄 Current: $current_test"
fi
completed=$(grep -c "✅ Completed in" statistical_run_full.log)
failed=$(grep -c "❌ Failed after" statistical_run_full.log)
echo "✅ Completed: $completed | ❌ Failed: $failed"
fi
check_timing_pattern
monitor_docker
analyze_runtime
echo ""
echo "Press Ctrl+C to stop monitoring..."
sleep 30
done