Created
July 25, 2017 12:44
-
-
Save pfreixes/e320b6f398aa7644c19188ccf2f443b1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import aioredis | |
| import asyncio | |
| OPS = 100000 | |
| async def main(loop): | |
| conn = await aioredis.create_redis(('localhost', 6379)) | |
| start = loop.time() | |
| for i in range(OPS): | |
| await conn.ping() | |
| lapsed = loop.time() - start | |
| print("Ping/sec {}".format(OPS/lapsed)) | |
| if __name__ == '__main__': | |
| loop = asyncio.get_event_loop() | |
| loop.run_until_complete(main(loop)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment