Closed rodneymo closed 7 years ago
This should work? You'd need to adjust the time interval to whatever interval you're checking by? If you have two entries with the same worker name they should be aggregated and come up as only one (in the case you mentioned about running pool-monitor manually). Frankly the manually thing trips up several of my panels as well. So that may be a reoccurring issue depending on what and how people want to graph.
I used mean here, but last or first would probably work. Since we don't really care what the HR is anyway.
select count("mean") from (select mean(hr) from workers_stats where time > now() -10m GROUP BY worker_id)
I think this gives you what you're trying to achieve?
That works. Still finding my way around influxQL. Thanks.
Yeah I had to search that one out. There is a HUGE thread requesting count to work on tags and some work arounds. I've had to do some funky compound sql statements on some of my graphs to get them to work the way I want.
Influx cannot apply aggregated functions to tags. So the "workers active" panel in grafana will need to use select count("hr") from worker_stats .... instead of select count(distinct("rig_id")) from worker_stats....
In a situation where the sysadmin needs to run the pool-monitor script manually e.g. debugging purposes, the number of workers will be wrongly calculated. Fix proposal: rig_id to be a field instead of tag in worker_stats measurement