1 | #!/bin/bash |
---|
2 | |
---|
3 | #+----------------------------------------------------------------------------- |
---|
4 | #+ Isidorus |
---|
5 | #+ (c) 2008-2010 Marc Kuester, Christoph Ludwig, Lukas Georgieff |
---|
6 | #+ |
---|
7 | #+ Isidorus is freely distributable under the LLGPL license. |
---|
8 | #+ You can find a detailed description in trunk/docs/LLGPL-LICENSE.txt and |
---|
9 | #+ trunk/docs/LGPL-LICENSE.txt. |
---|
10 | #+----------------------------------------------------------------------------- |
---|
11 | |
---|
12 | |
---|
13 | host="http://192.168.0.6:8000"; |
---|
14 | |
---|
15 | wDir="isidorus_test"; |
---|
16 | resDir="results" |
---|
17 | logDir="logfiles" |
---|
18 | |
---|
19 | T="true"; |
---|
20 | Nil="false"; |
---|
21 | |
---|
22 | doReq1=$T; |
---|
23 | doReq2=$T; |
---|
24 | doReq3=$T; |
---|
25 | doReq4=$T; |
---|
26 | |
---|
27 | dir1="req1"; |
---|
28 | dir2="req2"; |
---|
29 | dir3="req3"; |
---|
30 | dir4="req4"; |
---|
31 | |
---|
32 | req1=$host"/isidorus/json/psis/"; |
---|
33 | req2=$host"/isidorus/json/get/http://textgrid.org/serviceregistry/development/webpublish" |
---|
34 | req3=$host"/isidorus/json/tmcl/types/" |
---|
35 | req4=$host"/isidorus/json/topicstubs/http://textgrid.org/serviceregistry/development/webpublish" |
---|
36 | |
---|
37 | log1=$logDir"/"$dir1"/iteration_"; |
---|
38 | log2=$logDir"/"$dir2"/iteration_"; |
---|
39 | log3=$logDir"/"$dir3"/iteration_"; |
---|
40 | log4=$logDir"/"$dir4"/iteration_"; |
---|
41 | |
---|
42 | res1=$resDir"/"$dir1"/iteration_"; |
---|
43 | res2=$resDir"/"$dir2"/iteration_"; |
---|
44 | res3=$resDir"/"$dir3"/iteration_"; |
---|
45 | res4=$resDir"/"$dir4"/iteration_"; |
---|
46 | |
---|
47 | function flow { |
---|
48 | echo "==== iteration: ${1} ===="; |
---|
49 | counter=$1; |
---|
50 | if [ $1 -lt 10 ]; then |
---|
51 | counter="0000"$1; |
---|
52 | else |
---|
53 | if [ $1 -lt 100 ]; then |
---|
54 | counter="000"$1; |
---|
55 | else |
---|
56 | if [ $1 -lt 1000 ]; then |
---|
57 | counter="00"$1; |
---|
58 | else |
---|
59 | if [ $1 -lt 10000 ]; then |
---|
60 | counter="0"$1; |
---|
61 | fi |
---|
62 | fi |
---|
63 | fi |
---|
64 | fi |
---|
65 | |
---|
66 | |
---|
67 | if [ $doReq1 == $T ]; then |
---|
68 | path1=$log1$counter; |
---|
69 | result1=$res1$counter; |
---|
70 | wget -o $path1".log" -O $result1".res" $req1; |
---|
71 | fi |
---|
72 | |
---|
73 | if [ $doReq2 == $T ]; then |
---|
74 | path2=$log2$counter; |
---|
75 | result2=$res2$counter; |
---|
76 | wget -o $path2".log" -O $result2".res" $req2; |
---|
77 | fi |
---|
78 | |
---|
79 | if [ $doReq3 == $T ]; then |
---|
80 | path3=$log3$counter; |
---|
81 | result3=$res3$counter; |
---|
82 | wget -o $path3".log" -O $result3".res" $req3; |
---|
83 | fi |
---|
84 | |
---|
85 | if [ $doReq4 == $T ]; then |
---|
86 | path4=$log4$counter; |
---|
87 | result4=$res4$counter; |
---|
88 | wget -o $path4".log" -O $result4".res" $req4; |
---|
89 | fi |
---|
90 | } |
---|
91 | |
---|
92 | |
---|
93 | function init { |
---|
94 | mkdir $wDir; |
---|
95 | cd $wDir; |
---|
96 | |
---|
97 | if [ $doReq1 == $T ]; then |
---|
98 | mkdir -p $logDir"/"$dir1; |
---|
99 | mkdir -p $resDir"/"$dir1; |
---|
100 | fi |
---|
101 | |
---|
102 | if [ $doReq2 == $T ]; then |
---|
103 | mkdir -p $logDir"/"$dir2; |
---|
104 | mkdir -p $resDir"/"$dir2; |
---|
105 | fi |
---|
106 | |
---|
107 | if [ $doReq3 == $T ]; then |
---|
108 | mkdir -p $logDir"/"$dir3; |
---|
109 | mkdir -p $resDir"/"$dir3; |
---|
110 | fi |
---|
111 | |
---|
112 | if [ $doReq4 == $T ]; then |
---|
113 | mkdir -p $logDir"/"$dir4; |
---|
114 | mkdir -p $resDir"/"$dir4; |
---|
115 | fi |
---|
116 | } |
---|
117 | |
---|
118 | |
---|
119 | |
---|
120 | function main { |
---|
121 | init; |
---|
122 | |
---|
123 | for i in `seq 1 200000`; do |
---|
124 | flow $i; |
---|
125 | done |
---|
126 | } |
---|
127 | |
---|
128 | |
---|
129 | |
---|
130 | main; |
---|