hazelcast/hazelcast-jet-contrib

InfluxDB Sink sample does not make sense

Opened this issue · 0 comments

This is the InfluxDB Sink sample from the readme

Pipeline p = Pipeline.create();
p.drawFrom(Sources.list(measurements))
 .map(index -> Point.measurement("mem_usage")
                    .time(System.nanoTime(), TimeUnit.NANOSECONDS)
                    .addField("value", index)
                    .build())
 .drainTo(InfluxDbSinks.influxDb(DB_URL, DATABASE_NAME, USERNAME, PASSWORD));

.time(System.nanoTime(), TimeUnit.NANOSECONDS) makes no sense as nanoTime is only useful for measuring elapsed time on a single computer. It cannot be used as a sensible timestamp let alone persisted into a time series DB.