source: branches/new-datamodel/playground/isidorus_test.sh

Last change on this file was 312, checked in by lgiessmann, 14 years ago

added a test file for the threading problem with hunchentoot

  • Property svn:executable set to *
File size: 2.1 KB
Line 
1#!/bin/bash
2
3host="http://192.168.0.6:8000";
4
5wDir="isidorus_test";
6resDir="results"
7logDir="logfiles"
8
9T="true";
10Nil="false";
11
12doReq1=$T;
13doReq2=$T;
14doReq3=$T;
15doReq4=$T;
16
17dir1="req1";
18dir2="req2";
19dir3="req3";
20dir4="req4";
21
22req1=$host"/isidorus/json/psis/";
23req2=$host"/isidorus/json/get/http://textgrid.org/serviceregistry/development/webpublish"
24req3=$host"/isidorus/json/tmcl/types/"
25req4=$host"/isidorus/json/topicstubs/http://textgrid.org/serviceregistry/development/webpublish"
26
27log1=$logDir"/"$dir1"/iteration_";
28log2=$logDir"/"$dir2"/iteration_";
29log3=$logDir"/"$dir3"/iteration_";
30log4=$logDir"/"$dir4"/iteration_";
31
32res1=$resDir"/"$dir1"/iteration_";
33res2=$resDir"/"$dir2"/iteration_";
34res3=$resDir"/"$dir3"/iteration_";
35res4=$resDir"/"$dir4"/iteration_";
36
37function flow {
38    echo "==== iteration: ${1} ====";
39    counter=$1;
40    if [ $1 -lt 10 ]; then
41        counter="0000"$1;
42    else
43        if [ $1 -lt 100 ]; then
44            counter="000"$1;
45        else
46            if [ $1 -lt 1000 ]; then
47                counter="00"$1;
48            else
49                if [ $1 -lt 10000 ]; then
50                    counter="0"$1;
51                fi
52            fi
53        fi
54    fi
55
56
57    if [ $doReq1 == $T ]; then
58        path1=$log1$counter;
59        result1=$res1$counter;
60        wget -o $path1".log" -O $result1".res" $req1;
61    fi
62
63    if [ $doReq2 == $T ]; then
64        path2=$log2$counter;
65        result2=$res2$counter;
66        wget -o $path2".log" -O $result2".res" $req2;
67    fi
68
69    if [ $doReq3 == $T ]; then
70        path3=$log3$counter;
71        result3=$res3$counter;
72        wget -o $path3".log" -O $result3".res" $req3;
73    fi
74
75    if [ $doReq4 == $T ]; then
76        path4=$log4$counter;
77        result4=$res4$counter;
78        wget -o $path4".log" -O $result4".res" $req4;
79    fi
80}
81
82
83function init {
84    mkdir $wDir;
85    cd $wDir;
86
87    if [ $doReq1 == $T ]; then
88        mkdir -p $logDir"/"$dir1;
89        mkdir -p $resDir"/"$dir1;
90    fi
91
92    if [ $doReq2 == $T ]; then
93        mkdir -p $logDir"/"$dir2;
94        mkdir -p $resDir"/"$dir2;
95    fi
96
97    if [ $doReq3 == $T ]; then
98        mkdir -p $logDir"/"$dir3;
99        mkdir -p $resDir"/"$dir3;
100    fi
101
102    if [ $doReq4 == $T ]; then
103        mkdir -p $logDir"/"$dir4;
104        mkdir -p $resDir"/"$dir4;
105    fi
106}
107
108
109
110function main {
111    init;
112   
113    for i in `seq 1 200000`; do
114        flow $i;
115    done
116}
117
118
119
120main;
Note: See TracBrowser for help on using the repository browser.