From 8af26bd0b7bbde32a95ce937afc178e75c51da71 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Fri, 9 Jan 2015 16:40:26 +0100 Subject: fix #443 --- test/tools/bench.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/tools/bench.py (limited to 'test') 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 -- cgit v1.2.3