Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Influx DB precision setting at DB Level

Extension of #8746 :

I have tried to set the precision in the config file as seconds. But as i write data and tries to fetch it its again showing Nanoseconds timestamp.

I read the whole Doc but couldn't figure it out only change in my config file is: precision = "s"

help me understand these things

How do I set the precision at DB level and how will I make sure I only get set precision timestamps in epoch. And I am using IST as timezone for my Application so also tell me how to set the same for InfluxDB in configuration

I am using python-influxdb client seriesHelper to write data into db and not specifying any time while writing data.

Edit: Added a pull request to resolve this in influxdb-python SeriesHelper Class - #502

like image 843
Appunni M Avatar asked Sep 19 '17 07:09

Appunni M


1 Answers

Set query parameter epoch=s. See docs.

Query parameters are already supported by influxdb-python, for example:

client = InfluxDBClient(<..>)
client.query(<..>, params={'epoch': 's'})
like image 168
danny Avatar answered Sep 26 '22 08:09

danny