-
Notifications
You must be signed in to change notification settings - Fork 476
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
BatchOption doesn't support Precision. Defaults to nanosecond #532
Comments
@majst01 Any updates/comments on this one? |
I am afraid I can't reproduce this, with InfluxDB 1.7.3 and influx-java 2.14. The results are not having any values below seconds: Or do you mean you don't the trailing 0?
|
@asashour If you look at the above "point" I am sending time in "Seconds" but when influx-java client write that data to InfluxDB is write with precision=n (nanoseconds) |
I see, well I guess this is InfluxDB convention:
https://docs.influxdata.com/influxdb/v1.7/write_protocols/line_protocol_tutorial/#timestamp |
This is the HTTP doc of Influx https://docs.influxdata.com/influxdb/v1.7/tools/api/#write-http-endpoint It also says So coming back to the issue, the influx-java client is writing with a default precision of ns when using enableBatch option. It is missing the feature where user can choose what precision to write with. |
I see, the below case shows the that
Which prints
|
Actually, there is PatchPoints.Builder.precision():
In the line protocol is with SECONDS, and the precision parameter is used from the BatchPoints:
|
I agree BatchPoints have the feature to set the precision but I am not using BatchPoints. I am using When using influxDB.enableBatch I can specify certain properties using BatchOption but it is missing precision properties and ultimately everything that is written via InfluxDB.enableBatch is written as nanosecond precision. The bottom line is there is currently no way to set precision in this influxDB.enableBatch(BatchOptions.DEFAULTS.actions(2000).flushDuration(100)); |
Trying to write data to Influx async with batching enabled using this example below
There is no way to specify the Precision for the internal BatchPoints. It defaults to nanosecond whereas I am sending data with seconds precision only.
The BatchOption should have a feature to take precision as an input.
Am I missing something?
The text was updated successfully, but these errors were encountered: