__Proposal:__ Add a new aggregator to calculate Boolean True percentage over a time period
__Current behavior:__ Currently there is no way to see what percentage of measured points in a time period, your boolean was True (or False). You can do a SELECT COUNT(boolean) WHERE bool=true and a SELECT COUNT(boolean) WHERE bool=false and then calculate this percentage manually, but this is not very elegant.
__Desired behavior:__ I would appreciate a new aggregator that implicitly does SELECT COUNT(bool) WHERE bool=true / SELECT COUNT(bool). Alternatively, it is also possible to allow the aggregator MEAN to work with booleans (where True is 1 and False is 0, off course) and will return a float between 0 and 1, but this may be harder to implement.
__Use case:__ Logging sensor data of machines generates alot of booleans, and in some cases it is important to determine not only how often a boolean was True (or False) in a given period, but the percentage of measured points the sensor was True
This is causing me so much pain in trying to adopt Influx with Grafana. It's frustrating because on the surface it's such a simple task, but in reality it's become a really hard problem to solve in a trivial way. I can't display this as a single stat because Grafana can't combine data from multiple queries into a single stat, and I cannot get a series with historical data in a single query that I can graph. All I can do is a create a graph with two queries that shows the counts of TRUE and FALSE separately.
I don't want to greatly increase the complexity of my project by adopting Kapacitor or by introducing continuous queries that are obfuscated into the DB. For now I'll compute the relationship into a separate measurement via a script/cron job so it can be kept in source control.
Feel your pain. Hope this feature comes soon.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had recent activity. Please reopen if this issue is still important to you. Thank you for your contributions.
Most helpful comment
This is causing me so much pain in trying to adopt Influx with Grafana. It's frustrating because on the surface it's such a simple task, but in reality it's become a really hard problem to solve in a trivial way. I can't display this as a single stat because Grafana can't combine data from multiple queries into a single stat, and I cannot get a series with historical data in a single query that I can graph. All I can do is a create a graph with two queries that shows the counts of TRUE and FALSE separately.
I don't want to greatly increase the complexity of my project by adopting Kapacitor or by introducing continuous queries that are obfuscated into the DB. For now I'll compute the relationship into a separate measurement via a script/cron job so it can be kept in source control.