Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / bin / topinfo_iorsize_stats.sh
blob7fc5ea64f2058bc74ead5734947e6e2126008d91
1 #!/bin/sh
4 if [ $# -lt 3 ]; then
5 echo "Usage: $0 [DEST] [USER] [OPTIMIZED]"
6 exit 0
7 fi
9 DEST=$1
10 US=$2
11 OPT=$3
13 DATE=`date +%Y/%m/%d-%H:%M`
14 cd $ACE_ROOT
15 LD_LIBRARY_PATH=$ACE_ROOT/ace
16 export LD_LIBRARY_PATH
17 PATH=/usr/bin:/bin:$PATH
18 export PATH
19 cd $TAO_ROOT/performance-tests/Memory/IORsize
21 # start the server. If OPT == 1 then start the optimized version, else
22 # the non-optimized version
24 if test $OPT == 1
25 then ./server -ORBSvcConf server.conf &
26 else ./server &
29 s_id=$!;
31 server_start_size=`cat /proc/$s_id/status | grep VmRSS | awk '{print $2}'`;
33 # Just sleep for 2 seconds.
34 sleep 2;
35 # Check whether the server has started
36 file="test.ior"
37 if test -f $file
38 then
39 # start the client
40 ./client &
41 c_id=$!;
42 # Wait till all the invocations are done
43 sleep 30;
44 # Get the size once the client has made sufficient invocations.
45 s_invocations=`cat /proc/$s_id/status | grep VmRSS | awk '{print $2}'`;
46 let "actual_server_growth=${s_invocations}-${server_start_size}";
47 if test $OPT == 1
48 then
49 echo $DATE $s_invocations >> $DEST/source/server_opt_ior_size.txt
50 echo $DATE $actual_server_growth >> $DEST/source/opt_ior_size.txt
51 else
52 echo $DATE $s_invocations >> $DEST/source/server_ior_size.txt
53 echo $DATE $actual_server_growth >> $DEST/source/actual_ior_size.txt
56 # Kill the server and client. We will look at better ways of doing
57 # this later.
58 kill -9 $c_id;
59 kill -9 $s_id;
60 rm -f $file
61 else
62 echo $file doesnt exist
66 cd $DEST/source
67 STRING="for 50000 IORs"
68 FILES="server_opt opt server actual"
69 for i in $FILES ; do
70 /usr/bin/tac ${i}_ior_size.txt > $DEST/data/${i}_ior_size.txt
71 /usr/bin/tail -5 ${i}_ior_size.txt > $DEST/data/LAST_${i}_ior_size.txt
72 $ACE_ROOT/bin/generate_topinfo_charts.sh ${i}_ior_size.txt $DEST/images/${i}_ior_size.png ${i}_ior_size.txt
73 done