crow-metrics icon indicating copy to clipboard operation
crow-metrics copied to clipboard

Explicit Millisecond Precision in InfluxDB Exporter

Open lmangani opened this issue 8 years ago • 2 comments

Hi @robey

InfluxDB assumes that timestamps are in nanoseconds if you do not specify precision

This PR switches from the current nanosecond padding method to native JS millisecond timestamp by adding the precision query parameter to the default or custom postUrl, as suggested by the InfluxDB documentation to maximize performance. See Writing data to InfluxDB for an example.

Includes future-compatible precision parameter, and adjusted test cases.

PROPOSAL ONLY! REQUIRES REAL-LIFE TESTING, VALIDATION, SQUASHING ;)

lmangani avatar Apr 09 '18 21:04 lmangani

this looks good to me! let me know when/if you're satisfied it works in real life, and I'll merge it :)

robey avatar Apr 10 '18 17:04 robey

Thanks! I'll run this on a few more setups and perhaps let a couple peers test this too before confirming ;)

lmangani avatar Apr 10 '18 17:04 lmangani