diff options
author | Marcelo Glezer <mg@tekii.com.ar> | 2015-01-12 10:55:47 -0300 |
---|---|---|
committer | Marcelo Glezer <mg@tekii.com.ar> | 2015-01-12 10:55:47 -0300 |
commit | 27950f19721ae68152b84d874702ca81f1b6ecee (patch) | |
tree | 12573d1c3c9976d0b39016f3f45a0ef78c1a759d /test | |
parent | 30213d6370bca2bb222e315a63bf4d924a9b0b94 (diff) | |
parent | e18294437c4629f26dc65e16a9252ef61a109284 (diff) | |
download | mitmproxy-27950f19721ae68152b84d874702ca81f1b6ecee.tar.gz mitmproxy-27950f19721ae68152b84d874702ca81f1b6ecee.tar.bz2 mitmproxy-27950f19721ae68152b84d874702ca81f1b6ecee.zip |
Merge remote-tracking branch 'base/master'
Diffstat (limited to 'test')
-rw-r--r-- | test/tools/bench.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/tools/bench.py b/test/tools/bench.py new file mode 100644 index 00000000..1028f61d --- /dev/null +++ b/test/tools/bench.py @@ -0,0 +1,24 @@ +from __future__ import print_function +import requests, time + +n = 100 +url = "http://192.168.1.1/" +proxy = "http://192.168.1.115:8080/" + +start = time.time() +for _ in range(n): + requests.get(url, allow_redirects=False, proxies=dict(http=proxy)) + print(".", end="") +t_mitmproxy = time.time()-start + +print("\r\nTotal time with mitmproxy: {}".format(t_mitmproxy)) + + + +start = time.time() +for _ in range(n): + requests.get(url, allow_redirects=False) + print(".", end="") +t_without = time.time()-start + +print("\r\nTotal time without mitmproxy: {}".format(t_without))
\ No newline at end of file |