python influxdbclient-如何将精度设置为秒



我正在将数据点写入influxdb数据库,以便grafana显示。我有以epoch秒为单位的源数据点time

Grafana显示该点,但图形上的时间设置为1970。我怀疑这是精度问题,因为grafana默认使用纳秒。我试着用将精度设置为秒

from influxdb import InfluxDBClient

client.write_points(entry, params={'epoch': 's'})

但它会产生错误:

client.write_points(entry, params={'epoch': 's'})
TypeError: write_points() got an unexpected keyword argument 'params'

如果您想将精度设置为秒

client.write_points(entry, time_precision='s')

真的很管用。

最新更新