Hi, I think the answer to this question is "use CQ", but it seems like an obvious use case so maybe I've overlooked a better solution:
I have series collected every minute detailing the number of users per service per region. Let's say the measurement is called online_users with tags service and region. A region can have more than one service. I want to view the total number of users in a region in the last day: SELECT sum(value) FROM online_users WHERE region='xyz' AND time > NOW() - 1d I get my back expected results with 1 sample per minute with a sum of all users in all services in that region. All good so far. When I use Grafana and want to let it choose an appropriate interval (say 10 minutes), I would probably try this first: SELECT sum(value) FROM online_users WHERE region='xyz' AND time > NOW() - 1d GROUP BY time(10m) But this will give me the sum of all samples in that 10 minute period, effectively multiplying my results by 10. I could just divide by 10, but I don't have a way of conveniently being able to derive the number of expected samples per $interval. I could also take the mean and multiply it by the number of services, but I don't think a COUNT(DISTINCT()) works on tags. sum(mean()) gets thrown out by the parser. As I mentioned, this is something I do commonly in other TSDBs so I'm hoping I'm missing something obvious. Thanks! -- Remember to include the InfluxDB version number with all issue reports --- You received this message because you are subscribed to the Google Groups "InfluxDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/influxdb. To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/133633cd-4010-4a5c-88db-68b97f73e393%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
