计算与Grafana合作(Getting count to work with Grafana)

编程入门 行业动态 更新时间:2024-10-28 05:16:12
计算与Grafana合作(Getting count to work with Grafana)

我有一个有效的InfluxDB查询:

select count("cars") from "bridge_activity" where time > now() - 1m group by count

当我在仪表板上将此查询输入Grafana时,没有任何显示。 我一定会缩小到可以看到有问题的时间段。

我要做的是,记录过去一分钟过桥的汽车数量。 我想用它来衡量桥梁的相对活动。

我在Grafana仪表板上做错了什么?

I have an InfluxDB query that works:

select count("cars") from "bridge_activity" where time > now() - 1m group by count

When I enter this query into Grafana on a dashboard, nothing shows up. I've been sure to zoom out enough that the time period in question is visible.

What I'm trying to do is, keep track of the number of cars that have gone over the bridge, over the past minute. I'd like to use this as a measurement of relative activity for the bridge.

What am I doing wrong on the Grafana dashboard?

最满意答案

如果只需要singlestat面板的值,请group by count删除group by count 。

如果您希望绘制随时间变化的汽车数量,则需要SELECT count("cars") from "bridge_activity" GROUP BY time(1m)查询SELECT count("cars") from "bridge_activity" GROUP BY time(1m)

https://docs.influxdata.com/influxdb/v1.0/query_language/data_exploration/#group-by-time-intervals

Remove the group by count if you just want a value for a singlestat panel.

If you're looking to graph the number of cars over time, then you need a query like SELECT count("cars") from "bridge_activity" GROUP BY time(1m)

https://docs.influxdata.com/influxdb/v1.0/query_language/data_exploration/#group-by-time-intervals

更多推荐

本文发布于:2023-07-16 03:56:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1123397.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Grafana   count   work

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!