influxdb - python influxdbclient - 如何将精度设置为秒?
问题描述
我正在将数据点写入 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'
解决方案
如果要将精度设置为秒
client.write_points(entry, time_precision='s')
成功了。
推荐阅读
- asp.net-mvc - 来自控制器的批处理文件 - 如何在服务器端执行
- javascript - Vue 2.6.10 - 如何修复“属性或方法“索引”未在实例上定义,但在渲染期间被引用。在 v-for 循环中
- excel - 如何打开我刚刚在 Outlook 中解压缩的工作表
- android - Can I change a button visibility in a recyclerview only in one of cardview when gps data change
- c++ - 在 Omnet++ 的模拟期间更改/设置节点的新位置
- javascript - 在反应中动画(获取数据)后不是组件渲染
- selenium-chromedriver - 我在定位 div 标签内的输入标签时遇到问题
- office-js - setSolidColor 在图表系列的 Excel Javascript 中引发意外错误
- python - 什么不是如果,它与字符串有什么关系
- java - 在 Java Vert.x 上处理发布请求的有效方法?