According to the InfluxDB documentation, point data timestamp can be as fine grain as in nanoseconds.
Writing data using the HTTP API
The HTTP API is the primary means of putting data into InfluxDB. To
write data send a POST request to the /write endpoint. The example
below writes a single point to the mydb database. The data consist of
the measurement cpu_load_short, the tag keys host and region with the
tag values server01 and us-west, the field key value with a field
value of 0.64, and the timestamp 1434055562000000000.
Note: timestamp 1434055562000000000
.
As for writing point in nanoseconds using the npm node-influx module, you can use set the precision as 'ns' (nano-seconds). That is, precision: 'ns'
. To write points through the influx node module, it does not require you to have date objects thou, so if you know the exact date timestamp value since epoch, you can just pass in as 64 bit integer values for it to write into influx.
See example code here.
var influx = require('influx');
var databaseWriter = influx({
host: 'XXX',
port: 'XXX',
protocol: 'XXX',
username: 'XXX',
password: 'XXX',
database: 'XXX'
});
this.databaseWriter.writePoints(
'influx_stackoverflow_solution',
[
// point #1
[
{
"value": 999,
"time" : 1422568543702900257
},
{
'tag1' : 'value_in_nanoseconds'
}
],
// point #2
[
{
"value": 8888,
"time" : 1422568543702900600
},
{
'tag1' : 'value_in_nanoseconds'
}
]
],
{ precision: 'ns' },
function(errmsg, returnValue) {
if (errmsg) return callback(new Error(errmsg));
callback(null, returnValue);
}
);
Output:
