【问题标题】:python influxdbclient - how to set precision to seconds?python influxdbclient - 如何将精度设置为秒?
【发布时间】:2021-01-26 18:14:11
【问题描述】:

我正在将数据点写入 influxdb 数据库,供 grafana 显示。 我在纪元秒内有源数据点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'

【问题讨论】:

    标签: influxdb influxdb-python


    【解决方案1】:

    如果你想将精度设置为秒

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

    成功了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-28
      • 2017-08-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多