How to query percentage of counts?

Well done Fabrice. Care to share any more information? As I describe in the linked post, my preference was Kapacitor, but its infuriating inability to replay historical data in a predicable way killed that idea for me, hence the CQ route.