-
Notifications
You must be signed in to change notification settings - Fork 478
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
Why the library always passes timestamp to the server? #154
Comments
Yes, I can see that what you are saying is true. Maybe if I get some time I can look into this. However, for me it makes sense that the library takes the timestamps and that it does not rely on the server for the following reasons:
On a side note, I have had success with setting up my InfluxDB server as an NTP server and having my clients sync to it (though this would obviously depend a lot on the time resolution you are after). Additionally, I have a query about the comment 'guarantee uniqueness'... I don't think I understand this point? Are you tagging your points with something from each of the different 100 machines? (i.e. a tag like "machineId=1" / "machineId=2" or "machineMAC="aabbcc112233"?) Thanks |
Hi Andrew, Thanks for reply. In the library, API you allow the null value for the timestamp, but generate and pass timestamp in any case, no matter whether a caller is passing it or not. I believe this is wrong, and the caller should choose whether to pass the timestamp or not while working with the library. Regards, |
I don't think this change would be too hard to do, so if you want to submit a PR I'll have a look. I imagine it would be adding a method You could also tag your points with a unique value. ;-) |
We write more than a million records daily and I don't think add unique value to every point just, it's the exception rather than the rule. We've already made a fix in our own version of the client and use modified version now. Meanwhile I would like to have that fix in the client library out of the box, this way we can easy replace the library instead of making the fix with every client update. Can you please add the overloaded method like you suggested? |
I'll have a go when I get the time. Maybe this weekend? (I was unclear about the 'unique' tag...I meant add a tag that is unique for each client that you have, that way the combination of {tag & timestamp} would be unique from InfluxDBs perspective, thus records with identical timestamps but from different machines will be kept). |
I've implemented a tentative solution in the MR #168 |
Hi Rafael, Thanks for update! Regards, Lexalytics Read Between The Lines™ http://bd.semantria.com/a7f5c9324d3f737a5cwww.lexalytics.comhttp://www.lexalytics.com/ This message (including any attachments) may contain confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and contact the sender. From: Rafael Zanella <notifications@git.luolix.topmailto:notifications@github.com> I've implemented a tentative solution in the MR #168#168 — |
Fixed by #350 . |
Documentation says that timestamp is optional on the server side - https://docs.influxdata.com/influxdb/v0.10/guides/writing_data/
Why is the library passing timestamp always? There is a code in the build() method of Point class that validates the incoming value and if NULL passed, it uses System.currentTimeMillis().
As the result, the library is passing timestamp to the server, not depend on user's choice.
Additional validation is in formatedTime() method of Point class.
We would like to don't pass timestamp to the server to let InfluxDB generate timestamp on its own. There are more than 100 machines on our side which will write data to the database so we would like server to guarantee uniqueness of each record.
The text was updated successfully, but these errors were encountered: