aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/bench/benchmark.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/bench/benchmark.py b/test/bench/benchmark.py
index 8d208088..84ec6005 100644
--- a/test/bench/benchmark.py
+++ b/test/bench/benchmark.py
@@ -11,6 +11,15 @@ class Benchmark:
self.pr = cProfile.Profile()
self.started = False
+ self.resps = 0
+ self.reqs = 0
+
+ def request(self, f):
+ self.reqs += 1
+
+ def response(self, f):
+ self.resps += 1
+
async def procs(self):
ctx.log.error("starting benchmark")
backend = await asyncio.create_subprocess_exec("devd", "-q", "-p", "10001", ".")
@@ -23,6 +32,7 @@ class Benchmark:
)
stdout, _ = await traf.communicate()
open(ctx.options.benchmark_save_path + ".bench", mode="wb").write(stdout)
+ ctx.log.error("Proxy saw %s requests, %s responses" % (self.reqs, self.resps))
ctx.log.error(stdout.decode("ascii"))
backend.kill()
ctx.master.shutdown()