-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.sh
More file actions
executable file
·68 lines (53 loc) · 2.07 KB
/
Copy pathscript.sh
File metadata and controls
executable file
·68 lines (53 loc) · 2.07 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
#!/bin/bash
# --- CONFIGURATION ---
BINARY="./src/master_scan"
DURATION_MINUTES=30
END_TIME=$(( $(date +%s) + (DURATION_MINUTES * 60) ))
# --- METRICS ---
TOTAL_RUNS=0
TOTAL_PESSIMISTIC=0
TOTAL_PERFECT=0
SUM_LATENCY=0 # In milliseconds
echo "--- BORG-MANIFOLD AUDIT v2.0: START ---"
echo "Config: Seeds=2^27 | M=128 | Target: GOLD (>99.99%)"
echo "------------------------------------------------------"
while [ $(date +%s) -lt $END_TIME ]; do
((TOTAL_RUNS++))
# Capture start time in nanoseconds
START_NS=$(date +%s%N)
# Execute
OUTPUT=$($BINARY 2>&1)
# Capture end time
END_NS=$(date +%s%N)
# Calculate Latency for this run (ms)
RUN_LATENCY=$(( (END_NS - START_NS) / 1000000 ))
SUM_LATENCY=$(( SUM_LATENCY + RUN_LATENCY ))
# Process Results
RUN_PESSIMISTIC=$(echo "$OUTPUT" | grep -o "PESSIMISTIC" | wc -l)
RUN_PERFECT=$(echo "$OUTPUT" | grep -o "PERFECT" | wc -l)
((TOTAL_PESSIMISTIC += RUN_PESSIMISTIC))
((TOTAL_PERFECT += RUN_PERFECT))
# Real-time Telemetry
STATUS="[✓] OK"
if [ "$RUN_PESSIMISTIC" -gt 0 ]; then STATUS="[!] FAIL ($RUN_PESSIMISTIC Errors)"; fi
printf "Run #%-4d | %-18s | Latency: %-6d ms\n" "$TOTAL_RUNS" "$STATUS" "$RUN_LATENCY"
done
# --- FINAL CALCULATIONS ---
TOTAL_SECTORS=$((TOTAL_PERFECT + TOTAL_PESSIMISTIC))
UPTIME_PCT=$(echo "scale=4; (($TOTAL_SECTORS - $TOTAL_PESSIMISTIC) / $TOTAL_SECTORS) * 100" | bc)
AVG_LATENCY=$(echo "scale=2; $SUM_LATENCY / $TOTAL_RUNS" | bc)
echo ""
echo "------------------------------------------------------"
echo "FINAL PERFORMANCE REPORT"
echo "------------------------------------------------------"
echo "Total Execution Cycles: $TOTAL_RUNS"
echo "Total Sectors Scanned: $TOTAL_SECTORS"
echo "Average Run Time: $AVG_LATENCY ms"
echo "Symmetry Uptime: $UPTIME_PCT %"
echo "------------------------------------------------------"
# --- L11 CLASSIFICATION ---
if (( $(echo "$UPTIME_PCT >= 99.99" | bc -l) )); then
echo -e "RANK: \e[32mGOLD / PLATINUM\e[0m"
else
echo -e "RANK: \e[31mFAILURE - ESCALATE SEEDS\e[0m"
fi