34f9bff3ad30 — russes02 12 years ago
scripts: a couple more utility scripts, and makes memuse able to optionally not compress output
3 files changed, 56 insertions(+), 2 deletions(-)

M scripts/memuse.plot => scripts/memuse
A => scripts/progress
A => scripts/retryfailures
M scripts/memuse.plot => scripts/memuse +11 -2
@@ 1,5 1,11 @@ 
 #!/bin/bash
 
+GZIP=1
+if [[ $1 == "-u" ]]; then
+	GZIP=0
+	shift
+fi
+
 if [[ $1 == "" || -f $1 ]]; then
 	echo "USAGE: $0 <dir>"
 	exit 1

          
@@ 25,5 31,8 @@ plot '${DAT}' using 1:2 title "Alloc" wi
      '${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

          
A => scripts/progress +34 -0
@@ 0,0 1,34 @@ 
+#!/bin/bash
+
+D=`dirname $0`
+if [[ $1 == "" || -d $1 ]]; then
+	echo "USAGE: $0 <input>"
+	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

          
A => scripts/retryfailures +11 -0
@@ 0,0 1,11 @@ 
+#!/bin/bash
+
+if [[ $# -ne 1 ]]; then
+	echo "USAGE: $0 <input>"
+	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