Created
July 11, 2019 10:47
-
-
Save lovasoa/661257516d43dff6737b07aca66fb846 to your computer and use it in GitHub Desktop.
InfluxDB python client benchmark
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
| def test(client, n): | |
| """Stupid test function""" | |
| q = f"SELECT * FROM test LIMIT {n}" | |
| client.query(q) | |
| setup = """ | |
| from __main__ import test | |
| from influxdb import InfluxDBClient | |
| client = InfluxDBClient( | |
| 'localhost', | |
| 8086, | |
| 'root', | |
| 'root', | |
| 'my_db' | |
| ) | |
| """ | |
| if __name__ == '__main__': | |
| import timeit | |
| for n in range(0, 20000, 2000): | |
| t = timeit.timeit(f"test(client, {n})", setup=setup, number=10) | |
| print(n, t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment