Doxygen changes
[ACE_TAO.git] / ACE / bin / topinfo_stats.sh
blobc4bf54f8f0b60ebcaddf972e9cb923568e69cc2c
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:$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=`top -p $s_id -n 1 -b | grep $US| awk '{print $5}'`;
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=`top -p $s_id -n 1 -b | grep $US| awk '{print $5}'`;
43 echo $DATE $s_invocations >> $DEST/source/st_after_invoke_size.txt
45 # Kill the server and client. We will look at better ways of doing
46 # this later.
47 kill -9 $c_id;
49 # Just sleep for the server to release memory etc.
50 sleep 5;
52 # Get the size once the client is killed or crashed
53 s_client_death=`top -p $s_id -n 1 -b | grep $US| awk '{print $5}'`;
54 echo $DATE $s_client_death >> $DEST/source/st_after_peer_death_size.txt
55 kill -9 $s_id;
56 rm -f $file
57 else
58 echo $file doesnt exist
62 cd $DEST/source
63 STRING=""
64 FILES="start after_invoke after_peer_death"
65 for i in $FILES ; do
66 /usr/bin/tac st_${i}_size.txt > $DEST/data/st_${i}_size.txt
67 /usr/bin/tail -5 st_${i}_size.txt > $DEST/data/LAST_st_${i}_size.txt
68 $ACE_ROOT/bin/generate_topinfo_charts.sh st_${i}_size.txt $DEST/images/st_${i}_size.png st_${i}_size.txt $STRING
69 done