Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / bin / topinfo_simple_stats.sh
blob2726f8ec8c1ca8ea471370b3e84139fef6171cc3
1 #!/bin/sh
5 if [ $# -lt 2 ]; then
6 echo "Usage: $0 [DEST] [USER]"
7 exit 0
8 fi
10 DEST=$1
11 US=$2
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/Single_Threaded
20 # start the server
21 ./server &
22 s_id=$!;
23 # Just sleep for 2 seconds.
24 sleep 2;
25 # Check whether the server has started
26 file="test.ior"
27 if test -f $file
28 then
29 # Just get the size as soon the server is started, ie. the vanilla
30 # server.
31 s_up=`cat /proc/$s_id/status | grep VmRSS | awk '{print $2}'`;
33 # Write it a file
34 echo $DATE $s_up >> $DEST/source/st_start_size.txt
35 # start the client
36 ./client &
37 c_id=$!;
38 # Wait till all the invocations are done
39 sleep 10;
40 # Get the size once the client has made sufficient invocations.
41 s_invocations=`cat /proc/$s_id/status | grep VmRSS| awk '{print $2}'`;
43 echo $DATE $s_invocations >> $DEST/source/st_after_invoke_size.txt
45 # Get teh size of the client after all the invocations
46 c_invocations=`cat /proc/$c_id/status | grep VmRSS | awk '{print $2}'`;
47 echo $DATE $c_invocations >> $DEST/source/st_client_size.txt
49 # Kill the server and client. We will look at better ways of doing
50 # this later.
51 kill -9 $c_id;
53 # Just sleep for the server to release memory etc.
54 sleep 5;
56 # Get the size once the client is killed or crashed
57 s_client_death=`cat /proc/$s_id/status | grep VmRSS | awk '{print $2}'`;
58 echo $DATE $s_client_death >> $DEST/source/st_after_peer_death_size.txt
59 kill -9 $s_id;
60 rm -f $file
61 else
62 echo $file doesnt exist
66 cd $DEST/source
68 FILES="start after_invoke client after_peer_death"
69 for i in $FILES ; do
70 /usr/bin/tac st_${i}_size.txt > $DEST/data/st_${i}_size.txt
71 /usr/bin/tail -5 st_${i}_size.txt > $DEST/data/LAST_st_${i}_size.txt
72 $ACE_ROOT/bin/generate_topinfo_charts.sh st_${i}_size.txt $DEST/images/st_${i}_size.png st_${i}_size.txt
73 done