试图将一些传感器信息从 mysql 绘制到 grafana

Trying to plot some sensor info from mysql to grafana

我刚刚开始使用软件定义的无线电从我的电表中保存数据,我试图从 grafana 中的 mysql table 绘制此信息。

这是一些示例数据和我的查询:

 <a href="http://i.imgur.com/pWRt5Ma.png">
  <img src="http://imgur.com/pWRt5Mal.png" />
 </a>

创建 table 语句:

  <a href="http://i.imgur.com/Duy8Iqn.png">
   <img src="http://imgur.com/Duy8Iqnl.png" />
  </a>

我正在尝试找出使用 grafana 为单个 mId (%563) 绘制 mConsumed 到 mTime 的最佳方法。一旦我完成这项工作,我希望我的煤气表也能绘图。

好像怎么弄都不会出图,实在看不懂 http://docs.grafana.org/features/datasources/mysql/

我的grafana查询:

SELECT
   mTime as time_sec,
   mConsumed as value,
   'w' as metric
FROM UtilityMon.UtilityMeter
WHERE $__timeFilter(mTime)
AND mId like '%563'
ORDER BY mTime DESC;

如果你知道我做错了什么,请告诉我,因为我每时每刻都在失去理智。它确实适用于 influxdb,但我宁愿使用 mysql,因为 grafana 可以读取它。

我不得不对我的图像进行编码...抱歉没有足够的代表点...

编辑-我明白了!

SELECT
  mId as metric,
  mTime as time_sec,
  mConsumed as value
FROM UtilityMon.UtilityMeter
WHERE
  mId=xxxxxxxx
and
  $__unixEpochFilter(mTime)
;

工作得很好

SELECT
  mId as metric,
  mTime as time_sec,
  mConsumed as value
FROM UtilityMon.UtilityMeter
WHERE
  mId=xxxxyyyy
and
  $__unixEpochFilter(mTime)
;