Project

General

Profile

« Previous | Next » 

Revision 4910

Added by daigle over 15 years ago

Update load testing scripts

View differences:

test/stress-test/metacat.py
135 135
           content = ""
136 136
        conn.close()
137 137
        return content
138
        
139
    def getRequest(self, queryString):
140
        conn = httplib.HTTPConnection( self.metacatServer )
141
        #params = urllib.urlencode( postdata )
142
        #headers = { "Content-type" : "application/x-www-form-urlencoded", 
143
        #            "Accept"       : "*/*"}
138 144

  
145
        # If we have an active session, set the cookie
146
        #if self.sessionid is not None:
147
        #    headers['Cookie'] = self.sessionid
148

  
149
        conn.request( "GET", self.metacatUrlPath + queryString )
150
        response = conn.getresponse()
151

  
152
        # If metacat responds with a new session id,
153
        # register it with the metacat client instance
154
        #setcookie = response.getheader("set-cookie", None)
155
        #if setcookie:
156
        #    jsid = setcookie.split(';')[0]
157
        #    if jsid[:11] == "JSESSIONID=":
158
        #       self.sessionid = jsid
159
            
160
        if response.status == 200:
161
           content = response.read()
162
        else:
163
           print " SERVER DID NOT RETURN 'OK'.... STATUS is " + str(response.status) 
164
           content = ""
165
        conn.close()
166
        return content
167

  
test/stress-test/squery-load-test.py
71 71
	if response.find("<resultset>") != -1:
72 72
		debug("[%s] -- SUCCESS: elapsed time: %.5f seconds" % (word, t2-t1))
73 73
	else:
74
		debug("[%s] -- ERROR: " % (word), response)
74
		debug("[%s] -- ERROR: %s " % (word, response))
75 75
			
76 76
	iter_count = iter_count + 1
77 77
	debug2("iter_count: %d, iterations: %d" % (iter_count, iterations))
test/stress-test/read-load-test.py
83 83
	debug("[%s] -- ERROR: %s" % (docid, response))
84 84
t2 = time()
85 85

  
86
for i in range(1,iterations):
86
for i in range(0,iterations):
87 87
	t1 = time()
88 88

  
89 89
	debug("[%s] -- Processing Read" % (docid))
test/stress-test/load-test-driver.sh
10 10
# squery-load-test.py dictionary-letter iterations delay test-server 
11 11
######################
12 12

  
13
##### run squeries #####
14
#./squery-load-test.py m 50 2 dev.nceas.ucsb.edu 2>&1 &
13
./squery-load-test.py m 50 4 dev.nceas.ucsb.edu 2>&1 &
15 14

  
16
##### run squeries #####"
17
#./squery-load-test.py n 50 2 dev.nceas.ucsb.edu 2>&1 &
15
./squery-load-test.py n 50 4 dev.nceas.ucsb.edu 2>&1 &
18 16

  
19
##### run squeries #####
20
#./squery-load-test.py o 50 2 dev.nceas.ucsb.edu 2>&1 &
17
./squery-load-test.py o 50 4 dev.nceas.ucsb.edu 2>&1 &
21 18

  
22
##### run squeries #####
23
#./squery-load-test.py p 50 2 dev.nceas.ucsb.edu 2>&1 &
19
./squery-load-test.py p 50 4 dev.nceas.ucsb.edu 2>&1 &
24 20

  
25 21
######################
26 22
# insert-load-test.py dictionary-letter iterations delay test-server 
27 23
######################
28 24

  
29
##### run squeries #####
30
./insert-load-test.py a 50 2 dev.nceas.ucsb.edu 2>&1 &
25
./insert-load-test.py a 50 4 dev.nceas.ucsb.edu 2>&1 &
31 26

  
32
##### run squeries #####"
33
./insert-load-test.py b 50 2 dev.nceas.ucsb.edu 2>&1 &
27
./insert-load-test.py b 50 4 dev.nceas.ucsb.edu 2>&1 &
34 28

  
35
##### run squeries #####
36
./insert-load-test.py c 50 2 dev.nceas.ucsb.edu 2>&1 &
29
./insert-load-test.py c 50 4 dev.nceas.ucsb.edu 2>&1 &
37 30

  
38
##### run squeries #####
39
./insert-load-test.py d 50 2 dev.nceas.ucsb.edu 2>&1 &
31
./insert-load-test.py d 50 4 dev.nceas.ucsb.edu 2>&1 &
40 32

  
41 33
######################
42 34
# read-load-test.py prefix iterations delay test-server 
43 35
######################
44 36

  
45
##### run squeries #####
46
#./read-load-test.py a 300 3 dev.nceas.ucsb.edu 2>&1 &
37
./read-load-test.py a 50 4 dev.nceas.ucsb.edu 2>&1 &
47 38

  
48
##### run squeries #####"
49
#./read-load-test.py b 300 3 dev.nceas.ucsb.edu 2>&1 &
39
./read-load-test.py b 50 4 dev.nceas.ucsb.edu 2>&1 &
50 40

  
51
##### run squeries #####
52
#./read-load-test.py c 300 3 dev.nceas.ucsb.edu 2>&1 &
41
./read-load-test.py c 50 4 dev.nceas.ucsb.edu 2>&1 &
53 42

  
54
##### run squeries #####
55
#./read-load-test.py d 300 3 dev.nceas.ucsb.edu 2>&1 &
43
./read-load-test.py d 50 4 dev.nceas.ucsb.edu 2>&1 &
56 44

  
45
######################
46
# read-get-load-test.py prefix iterations delay test-server 
47
######################
48

  
49
./read-get-load-test.py a 50 4 dev.nceas.ucsb.edu 2>&1 &
50

  
51
./read-get-load-test.py b 50 4 dev.nceas.ucsb.edu 2>&1 &
52

  
53
./read-get-load-test.py c 50 4 dev.nceas.ucsb.edu 2>&1 &
54

  
55
./read-get-load-test.py d 50 4 dev.nceas.ucsb.edu 2>&1 &
56

  
57
sleep 4
57 58
echo
58 59
echo "Running the following load tests:"
59 60
ps auxwww |grep load-test.py |grep -v grep

Also available in: Unified diff