# HG changeset patch
# User russes02
# Date 1343761444 14400
# Tue Jul 31 15:04:04 2012 -0400
# Node ID 34f9bff3ad30d5a88146b38dd5a530ed34eb3d95
# Parent 42b7121444091f334371bf1dd71bd40829987092
scripts: a couple more utility scripts, and makes memuse able to optionally not compress output
diff --git a/scripts/memuse.plot b/scripts/memuse
rename from scripts/memuse.plot
rename to scripts/memuse
--- a/scripts/memuse.plot
+++ b/scripts/memuse
@@ -1,5 +1,11 @@
#!/bin/bash
+GZIP=1
+if [[ $1 == "-u" ]]; then
+ GZIP=0
+ shift
+fi
+
if [[ $1 == "" || -f $1 ]]; then
echo "USAGE: $0
"
exit 1
@@ -25,5 +31,8 @@
'${DAT}' using 1:3 title "System" with lines, \
'${DAT}' using 1:4 title "Comparisons" smooth bezier with lines axis x1y2
EOF
-gzip ${BASE}/memuse.svg
-mv ${BASE}/memuse.svg.gz ${BASE}/memuse.svgz
+
+if [[ $GZIP -eq 1 ]]; then
+ gzip ${BASE}/memuse.svg
+ mv ${BASE}/memuse.svg.gz ${BASE}/memuse.svgz
+fi
diff --git a/scripts/progress b/scripts/progress
new file mode 100755
--- /dev/null
+++ b/scripts/progress
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+D=`dirname $0`
+if [[ $1 == "" || -d $1 ]]; then
+ echo "USAGE: $0 "
+ exit 1
+fi
+INPT=$1
+BASE=`dirname $1`
+
+T=`wc -l < ${INPT}`
+SD=`grep memory ${BASE}/errs.txt | head -n 1 | awk '{print $1" "$2}'`
+SS=`date -d "$SD" +%s`
+while true; do
+ clear
+ date
+ P=`wc -l < ${BASE}/out.csv`
+ pc=`dc -e "2k$P $T/100*p" | awk -F . '{print $1}'`
+ printf "Processed %d / %d (%g%%)\n" $P $T $pc
+
+ ED=`tail -n 1000 ${BASE}/errs.txt | grep memory | tail -n 1 | awk '{print $1" "$2}'`
+ ES=`date -d "$ED" +%s`
+ SECS=$(($ES - $SS))
+ pph=`dc -e "2k$P $SECS 3600//p"`
+ printf "Run time: %02d:%02d:%02d (%g p/h)\n" $(($SECS/3600)) $(($SECS%3600/60)) $(($SECS%60)) $pph
+
+ TIMEREMAIN=`dc -e "4k$T $P-$pph/3600*p"`
+ TIMEREMAIN=`dc -e "$TIMEREMAIN 1/p"`
+ ETA=`date -d "$TIMEREMAIN seconds" +%H:%M:%S`
+ printf "Remaining time est.: %02d:%02d:%02d (%s)\n" $(($TIMEREMAIN/3600)) $(($TIMEREMAIN%3600/60)) $(($TIMEREMAIN%60)) $ETA
+ ${D}/memuse.plot -u $BASE
+ cp ${BASE}/memuse.svg ~/public_html/memuse.svg
+ sleep 30
+done
diff --git a/scripts/retryfailures b/scripts/retryfailures
new file mode 100755
--- /dev/null
+++ b/scripts/retryfailures
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+if [[ $# -ne 1 ]]; then
+ echo "USAGE: $0 "
+ exit 1
+fi
+INPUT=$1
+DIR=`dirname $INPUT`
+
+grep FAIL $DIR/out.csv.new | grep -v MIGRATION | awk -F, '{print $2}' | sort | uniq | grep -f - $INPUT
+#grep FAIL $1/out.csv | grep -v MIGRATION | grep -v NRMSD | awk -F, '{print $2}' | sort | uniq | grep -f - $1/page-report.csv