When creating points to write to influx using Java Instant:
Instant stamp = Instant.now();
Point point1 = Point.measurement("cpu")
.time(stamp.getEpochSecond() * 1000000000 + stamp.getNano(), TimeUnit.NANOSECONDS)
.addField("idle", 90L)
.addField("system", 1L)
.build();
From Java Instant documentation:
The range of an instant requires the storage of a number larger than a long. To achieve this, the class stores a long representing epoch-seconds and an int representing nanosecond-of-second, which will always be between 0 and 999,999,999.
So the previous code may overflow the Long field for time. Maybe time would be better as BigInteger?
When creating points to write to influx using Java Instant:
From Java Instant documentation:
So the previous code may overflow the Long field for time. Maybe time would be better as BigInteger?