/[resiprocate]/main/resip/stack/test/testStackPerfPlot.sh
ViewVC logotype

Contents of /main/resip/stack/test/testStackPerfPlot.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8131 - (show annotations) (download) (as text)
Sat Jul 12 05:27:59 2008 UTC (11 years, 5 months ago) by alan
File MIME type: application/x-sh
File size: 1730 byte(s)
added data generation frame (incomplete) plot col 1 against 3
1 #!/bin/bash
2
3 # This is in two parts.
4 # 1. Run lots of times to make some data.
5 # 2. Plot the data.
6 # Can override the test driver with --driver="./testFnoo --arg1 --arg2=x "
7 # Will always append --num-runs
8 #
9 # In general, you want to run this with --generate NAME.
10
11 # Once you have some data in perfdata/*, you can run this with --plot.
12
13 # Make data -- each run makes a file called 'NAME'
14
15 driver=./testStack\ --bind=127.0.0.1
16
17
18 while [ $# -gt 1 ]; do
19 case $1 in
20 --dri*)
21 driver=${1##--*=}
22 ;;
23 --gen*)
24 if [ $# -ne 3 ]; then
25 echo usage: $0 --generate name num
26 exit -1
27 fi
28 # check for test driver
29 if [ ! -x ./testStack ]; then
30 echo $driver not executable or missing.
31 exit -2
32 fi
33 [ -d data ] || mkdir data
34 name=$2
35 nruns=$3
36 output="data/$name"
37 if [ -f "$output" ]; then
38 echo "$output: exists, please choose alternate name or remove file"
39 exit -3
40 fi
41 while [ $nruns -gt 0 ]; do
42 # cross plat random number
43 nr=$( dd if=/dev/random count=1 bs=4 2> /dev/null | od -d |\
44 awk '/^000* /,// {print $2$3;}')
45 nr=$(( $nr % 100000 + 1))
46 echo runs left $nruns -- this run for $nr REGISTERs
47 $driver --num-runs=$nr | awk '/registrations per?formed/ { print $1 " " $5 " "$10;}' >> "$output"
48 nruns=$(( $nruns - 1 ))
49 done
50 ;;
51 --pl*)
52 echo plot mode
53 ;;
54 *)
55 ;;
56 esac
57 shift
58 done
59

Properties

Name Value
svn:executable *

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27