From 325186b237ed1e67a513d58794fc7c18f87bd0ab Mon Sep 17 00:00:00 2001 From: Stephen McQuay Date: Wed, 6 Feb 2013 00:35:17 -0800 Subject: [PATCH] added simple stress test --- .gitignore | 2 ++ stress.py | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 stress.py diff --git a/.gitignore b/.gitignore index 58bd488..ee55028 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ db.json +sj.mcquay.me +tags diff --git a/stress.py b/stress.py new file mode 100644 index 0000000..15356b2 --- /dev/null +++ b/stress.py @@ -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) +