aboutsummaryrefslogtreecommitdiffstats
path: root/test/helper_tools/bench.py
diff options
context:
space:
mode:
authorThomas Kriechbaumer <Kriechi@users.noreply.github.com>2017-02-15 00:24:05 +0100
committerGitHub <noreply@github.com>2017-02-15 00:24:05 +0100
commitbb2fa6dc7d871d703c6759926521d8c16aae80f1 (patch)
tree63439432d40bd5f0740000b71da0dc6df6053e3c /test/helper_tools/bench.py
parenta3436897ad8c504c08cff40bcddd7915c13a4712 (diff)
parent4d973e82959f5aecab8313b43ce1ab484f21b536 (diff)
downloadmitmproxy-bb2fa6dc7d871d703c6759926521d8c16aae80f1.tar.gz
mitmproxy-bb2fa6dc7d871d703c6759926521d8c16aae80f1.tar.bz2
mitmproxy-bb2fa6dc7d871d703c6759926521d8c16aae80f1.zip
Merge pull request #2026 from Kriechi/filename-matching
add filename-matching linter
Diffstat (limited to 'test/helper_tools/bench.py')
-rw-r--r--test/helper_tools/bench.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/helper_tools/bench.py b/test/helper_tools/bench.py
new file mode 100644
index 00000000..fb75ef46
--- /dev/null
+++ b/test/helper_tools/bench.py
@@ -0,0 +1,23 @@
+import requests
+import 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))