MCPcopy Create free account
hub / github.com/mitmproxy/mitmproxy / procs

Method procs

test/bench/benchmark.py:26–42  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

24 self.resps += 1
25
26 async def procs(self):
27 logging.error("starting benchmark")
28 backend = await asyncio.create_subprocess_exec("devd", "-q", "-p", "10001", ".")
29 traf = await asyncio.create_subprocess_exec(
30 "wrk",
31 "-c50",
32 "-d5s",
33 "http://localhost:%s/benchmark.py" % ctx.master.server.address[1],
34 stdout=asyncio.subprocess.PIPE,
35 )
36 stdout, _ = await traf.communicate()
37 with open(ctx.options.benchmark_save_path + ".bench", mode="wb") as f:
38 f.write(stdout)
39 logging.error(f"Proxy saw {self.reqs} requests, {self.resps} responses")
40 logging.error(stdout.decode("ascii"))
41 backend.kill()
42 ctx.master.shutdown()
43
44 def load(self, loader):
45 loader.add_option(

Callers 1

runningMethod · 0.95

Calls 5

errorMethod · 0.45
writeMethod · 0.45
decodeMethod · 0.45
killMethod · 0.45
shutdownMethod · 0.45

Tested by

no test coverage detected