added simple stress test

This commit is contained in:
Stephen McQuay 2013-02-06 00:35:17 -08:00
parent 4fcaceb7e4
commit 325186b237
2 changed files with 20 additions and 0 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
db.json
sj.mcquay.me
tags

18
stress.py Normal file
View File

@ -0,0 +1,18 @@
import random
import requests
import time
start = time.time()
count = 0
while True:
try:
r = requests.get("http://localhost:8000/hell/from/python/{}".format(
random.randint(0,2000)))
count += 1
except KeyboardInterrupt:
break
end = time.time()
print count, end - start
print count / (end - start)