Timestamp issue with InfluxDB 0.9
cemo opened this issue · comments
Cemalettin Koc commented
Hey, thanks for the library.
The documention of InfluxDB states a timestamp:
The timestamp - supplied at the end of the line in Unix time in nanoseconds
since January 1, 1970 UTC - is optional. If you do not specify a timestamp InfluxDB
uses the server’s local nanosecond timestamp in Unix epoch. Anything that has to
do with time in InfluxDB is always UTC.
However MeasurementReporter is using getTime
which is equals to System.currentTimeMillis
. Am I missing something?
Cemalettin Koc commented
A quick fix might be adding precision to url. I have added precision=ms
below in HttpInlinerSender.
try {
if (protocol.isSecured()) {
toJoin = new URL("http", protocol.getHost(), protocol.getPort(), "/write?&precision=ms&db=" + Miscellaneous.urlEncode(protocol.getDatabase()) + "&u="
+ Miscellaneous.urlEncode(protocol.getUser()) + "&p=" + Miscellaneous.urlEncode(protocol.getPassword()));
} else {
toJoin = new URL("http", protocol.getHost(), protocol.getPort(), "/write?precision=ms&db=" + Miscellaneous.urlEncode(protocol.getDatabase()));
}
} catch (MalformedURLException | UnsupportedEncodingException e) {
toJoin = null;
}
David Bernard commented
I missed this ticket, sorry