Home | History | Annotate | Line # | Download | only in testdir
      1  1.1  christos awk '
      2  1.1  christos BEGIN {
      3  1.1  christos 	OFS = "\t"
      4  1.1  christos 	print "     new      old   new/old"
      5  1.1  christos 	print ""
      6  1.1  christos }
      7  1.1  christos /differ/
      8  1.1  christos /:$/ {	name = $1; cnt = 0; next }
      9  1.1  christos $1 ~ /user|sys/ {
     10  1.1  christos 	n = split($2, x, "m")	# 0m0.23s
     11  1.1  christos 	if (n == 1)
     12  1.1  christos 		time[cnt] += x[1]
     13  1.1  christos 	else
     14  1.1  christos 		time[cnt] += 60 * x[1] + x[2]
     15  1.1  christos }
     16  1.1  christos $1 ~ /sys/ {
     17  1.1  christos 	cnt++
     18  1.1  christos 	if (cnt == 2)
     19  1.1  christos 		dump()
     20  1.1  christos }
     21  1.1  christos function dump() {
     22  1.1  christos 	old = time[1]
     23  1.1  christos 	new = time[0]
     24  1.1  christos 	if (old > 0) {
     25  1.1  christos 		printf "%8.2f %8.2f %8.3f  %s\n", new, old, new/old, name
     26  1.1  christos 		rat += new/old
     27  1.1  christos 	}
     28  1.1  christos 	nrat++
     29  1.1  christos 	totnew += new
     30  1.1  christos 	totold += old
     31  1.1  christos 	time[0] = time[1] = cnt = 0
     32  1.1  christos }
     33  1.1  christos END {
     34  1.1  christos 	print ""
     35  1.1  christos 	printf "%8.2f %8.2f\n\n", totnew, totold
     36  1.1  christos 	printf "avg new/old   = %.3f\n", rat/nrat
     37  1.1  christos 	printf "total new/old = %.3f\n", totnew/totold
     38  1.1  christos 	print nrat " tests"
     39  1.1  christos }
     40  1.1  christos ' $*
     41