pjcalvo / locust-influxdb-listener

LocustIO base project with a custom influxDB listener.
MIT License
26 stars 20 forks source link

Add a connected parameter. #12

Closed obriat closed 3 years ago

pjcalvo commented 3 years ago

Yeah __init__ shouldn't return anything. But adding a new parameter and returning the entire instance to check the connection seems like an overkill.

Please make it so that it re-throws the exception in case of error instead so users can handle it as they want....

We can also add the retry mechanism later inside the library... In another PR.

obriat commented 3 years ago

If it seems better to you, I'll remade this PR.

I also didn't try to test the state of the influxdb_client parameter... I also discover that you can provide a retry strategy to it : https://github.com/influxdata/influxdb-client-python#http-retry-strategy with a custom backoff_factor https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html

pjcalvo commented 3 years ago

Not moving forward with this PR. Use the .ping method to check for connectivity.