vote making scripts
This commit is contained in:
Родитель
e9a7bdb19f
Коммит
ba815ba7c1
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
# create POST data files with ab friendly formats
|
||||
python make-data.py
|
||||
|
||||
# create 3000 votes
|
||||
ab -n 1000 -c 50 -p posta -T "application/x-www-form-urlencoded" http://vote/
|
||||
ab -n 1000 -c 50 -p postb -T "application/x-www-form-urlencoded" http://vote/
|
||||
ab -n 1000 -c 50 -p posta -T "application/x-www-form-urlencoded" http://vote/
|
|
@ -0,0 +1,13 @@
|
|||
# this creates urlencode-friendly files without EOL
|
||||
import urllib
|
||||
outfile = open('postb', 'w')
|
||||
params = ({ 'vote': 'b' })
|
||||
encoded = urllib.urlencode(params)
|
||||
outfile.write(encoded)
|
||||
outfile.close()
|
||||
outfile = open('posta', 'w')
|
||||
params = ({ 'vote': 'a' })
|
||||
encoded = urllib.urlencode(params)
|
||||
outfile.write(encoded)
|
||||
outfile.close()
|
||||
|
|
@ -0,0 +1 @@
|
|||
vote=a
|
|
@ -0,0 +1 @@
|
|||
vote=b
|
Загрузка…
Ссылка в новой задаче