:!/bin/sh
#  REPT 	report Suite III output	
#  (C) COPYRIGHT 1986
#  AIM TECHNOLOGY INCORPORATED ALL RIGHTS RESERVED 
# 
# %W% %G%  --  AIM Benchmarks Suite III SERIALNO

if test ! -r toutput
then
    echo "No toutput file in current directory " > /dev/tty
    exit 1
fi
inter=0
if test $# -gt 0 -a "$1" = -i
then
    inter=1
    cat toutput | awk 'BEGIN {n=1 
    x[1] = "1"; x[2] = "2"; x[3] = "3"; x[4] = "4"; x[5] = "5"; x[6] ="6";
    x[7] = "7"; x[8] = "8"; x[9] = "9"; x[10] = "a"; x[11] = "b"; x[12] ="c";
    x[13] = "d"; x[14] = "e"; x[15] = "f"; x[16] = "g"; x[17] = "h"; x[18] ="i";
    x[19] = "j"; x[20] = "k"}
    /:/ {printf "%s%s\n",x[n],$0 ;n++}' > /dev/tty
    echo " " 
    echo "please choose labels of machines to evaluate: " > /dev/tty
    read numbers
fi
echo "Do you wish to see large plots or small plots? (l) or (s): " > /dev/tty
read size
wid=75
high=20
if test $size = l
then
	wid=118
	high=59
	if test $inter = "1"
	then
	    if test -z "$numbers" 
	    then
		mnumbs=`grep -c : toutput`
	    else
	        set $numbers
	    	mnumbs=$#
	    fi
	    high=`expr 59 - $mnumbs `
	else
	    mnumbs=`grep -c : toutput`
	    high=`expr 59 - $mnumbs `
	fi
fi
filter $numbers
echo "                              Response time degradation "
./plot -h$high -w$wid -x2 %2.0f -y3 %4.1f -p1 %123456789abcdefghijk -e seconds tinput
echo "                               number of concurrent users --> "
echo " "
if test $inter = "1" -a -n "$numbers"
then
cat toutput | awk 'BEGIN {n=1 
    x[1] = "1"; x[2] = "2"; x[3] = "3"; x[4] = "4"; x[5] = "5"; x[6] ="6";
    x[7] = "7"; x[8] = "8"; x[9] = "9"; x[10] = "a"; x[11] = "b"; x[12] ="c";
    x[13] = "d"; x[14] = "e"; x[15] = "f"; x[16] = "g"; x[17] = "h"; x[18] ="i";
    x[19] = "j"; x[20] = "k"}
    /:/ {printf "%s%s\n",x[n],$0 ;n++}' | grep "^[$numbers]:"
else
cat toutput | awk 'BEGIN {n=1 
    x[1] = "1"; x[2] = "2"; x[3] = "3"; x[4] = "4"; x[5] = "5"; x[6] ="6";
    x[7] = "7"; x[8] = "8"; x[9] = "9"; x[10] = "a"; x[11] = "b"; x[12] ="c";
    x[13] = "d"; x[14] = "e"; x[15] = "f"; x[16] = "g"; x[17] = "h"; x[18] ="i";
    x[19] = "j"; x[20] = "k"}
    /:/ {printf "%s%s\n",x[n],$0 ;n++}'
fi
echo ""
echo "                               User Throughput "
./plot -h$high -w$wid -x2 %2.0f -y5 %4.4f -p1 %123456789abcdefghijk -e proc/sec tinput
echo "                               number of concurrent users --> "
echo " "
if test $inter = "1" -a -n "$numbers"
then
cat toutput | awk 'BEGIN {n=1 
    x[1] = "1"; x[2] = "2"; x[3] = "3"; x[4] = "4"; x[5] = "5"; x[6] ="6";
    x[7] = "7"; x[8] = "8"; x[9] = "9"; x[10] = "a"; x[11] = "b"; x[12] ="c";
    x[13] = "d"; x[14] = "e"; x[15] = "f"; x[16] = "g"; x[17] = "h"; x[18] ="i";
    x[19] = "j"; x[20] = "k"}
    /:/ {printf "%s%s\n",x[n],$0 ;n++}' | grep "^[$numbers]:"
else
cat toutput | awk 'BEGIN {n=1 
    x[1] = "1"; x[2] = "2"; x[3] = "3"; x[4] = "4"; x[5] = "5"; x[6] ="6";
    x[7] = "7"; x[8] = "8"; x[9] = "9"; x[10] = "a"; x[11] = "b"; x[12] ="c";
    x[13] = "d"; x[14] = "e"; x[15] = "f"; x[16] = "g"; x[17] = "h"; x[18] ="i";
    x[19] = "j"; x[20] = "k"}
    /:/ {printf "%s%s\n",x[n],$0 ;n++}'
fi
echo ""
