-
Notifications
You must be signed in to change notification settings - Fork 116
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
Automatically set time on WritePoint #342
Comments
@shreyas44, thanks for using this client. Why do you think write silently fails? How are you checking data is written? |
Oh I see, didn't know that.
I write a bunch of points (~1000) to influxdb over a couple of seconds and count the number of results in the last few minutes using flux. The count is usually in single digits. Maybe if I don't check for points within a time period, I should see the expected 1000? |
When you write a batch of points without timestamp and several points have the same tags, it can happen that the server will assign the same timestamp because the highest resolution is nanoseconds. It can lead to overwriting of points. |
You might be right. This issue doesn't pop up when writing each point synchronously without explicitly setting the time. |
I still think it'd be a good idea to automatically set the time to the current time in |
Proposal:
Automatically set the time to the current time in
write.Point
if the time hasn't already been set when a call towriteAPI.WritePoint
is madeCurrent behavior:
The time is assumed to be zero and writes to influxdb silently fail when
SetTime
isn't usedDesired behavior:
Automatically set the time to the current time in
write.Point
if the time hasn't already been setAlternatives considered:
NewPoint
orNewPointWithMeasurement
could automatically set the time to the current timeUse case:
Make it a little less verbose to write points and stop failing silently
The text was updated successfully, but these errors were encountered: