-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94077d6
commit 12c8c5b
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import asyncio | ||
|
||
import requests | ||
from codetiming import Timer | ||
|
||
URL = "http://localhost:8000/entities?schema=Membership&nested=1&page={i}&limit=100" | ||
|
||
|
||
async def task(i): | ||
with Timer(text=f"Page {i} elapsed time: {{:.1f}}"): | ||
res = requests.get(URL.format(i=i)) | ||
assert res.ok | ||
|
||
|
||
async def main(): | ||
tasks = [asyncio.create_task(task(i)) for i in range(1, 100)] | ||
await asyncio.gather(*tasks) | ||
|
||
|
||
if __name__ == "__main__": | ||
asyncio.run(main()) |