Add log when response is generated from scratch

This commit is contained in:
Ben Sarmiento
2023-11-30 03:38:57 +01:00
parent 5914af80fd
commit c6e4a304bf
3 changed files with 20 additions and 14 deletions

View File

@@ -14,7 +14,7 @@ async def extract_links(url):
async def benchmark(url):
# This will still block, because subprocess.run is not async
subprocess.run(['hey', '-n', '100000', '-c', '100', url])
subprocess.run(['hey', '-n', '10000', '-c', '50', url])
url = 'http://localhost:9999/http/'
@@ -25,7 +25,9 @@ async def main():
print("BENCHMARKING " + link)
await benchmark(link)
async for inl in extract_links(link):
print("BENCHMARKING " + inl)
await benchmark(inl)
# Python 3.7+
asyncio.run(main())