| 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( |