Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more verbosity #95

Closed
macd2 opened this issue May 13, 2020 · 3 comments
Closed

more verbosity #95

macd2 opened this issue May 13, 2020 · 3 comments
Labels
question Further information is requested
Milestone

Comments

@macd2
Copy link

macd2 commented May 13, 2020

When writing lines with client.write() than many times I do not get any output (function returns None) but the line was not written to influx and have no clue why. So is there a way to get some more info about the result of the action?

@bednar bednar added the question Further information is requested label May 14, 2020
@bednar
Copy link
Contributor

bednar commented May 14, 2020

Hi @macd2,

client.write() returns None because the default strategy for write is batching. If you would like to directly write data use synchronous strategy:

from influxdb_client import InfluxDBClient, Point
from influxdb_client .client.write_api import SYNCHRONOUS

client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org")
write_api = client.write_api(write_options=SYNCHRONOUS)

_point1 = Point("my_measurement").tag("location", "Prague").field("temperature", 25.3)
_point2 = Point("my_measurement").tag("location", "New York").field("temperature", 24.3)

write_api.write(bucket="my-bucket", record=[_point1, _point2])

client.__del__()

The client could be configured to debug verbosity by:

client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org", debug=True)

Regards

@macd2
Copy link
Author

macd2 commented May 20, 2020

thank you very much this solves my issue!

@macd2 macd2 closed this as completed May 20, 2020
@bednar bednar added this to the 1.8.0 milestone May 20, 2020
@bednar
Copy link
Contributor

bednar commented May 20, 2020

You are welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants