On your group by time (1d) query, do a RESAMPLE EVERY 12h FOR 24h. Here's what that will do:
Say we have today: 2016-12-28. At 12:00 UTC it will run the query for the day, giving you partial results. That's the EVERY part of the clause. It will run again at 00:00 on 12-29, giving you full results for the day. The FOR clause is for when you have lagged data collection. If you don't, then leave it out. If you do then you'll want to set that for an interval of time for when you know all your data will be in. In my example above, I set it to 24h. That means the CQ for 2016-12-18 will be run again at 12:00 on 12-19 and 00:00 on 12-20. So in that example, the CQ result will be calculated four times. Once in the middle of the interval, once at the end, once 12 hours after the interval has passed and once 24 hours after the interval has passed. On Tue, Dec 27, 2016 at 1:53 PM, Ryan January <[email protected]> wrote: > I'm running into an issue I haven't yet been able to understand yet. > > I'm trying to reduce the granularity of data in a measurement named > 'tablespace_utilization'. I would like the data at a daily interval by > using the following continuous query. > > CREATE CONTINUOUS QUERY tablespace_utilization_downsample ON telegraf > RESAMPLE EVERY 1d FOR 36h BEGIN SELECT max(bytes) AS bytes INTO > telegraf.autogen.tablespace_utilization_1d FROM > telegraf.autogen.tablespace_utilization GROUP BY time(1d), > collection_host, "database", tablespace_name, owner END > > Unfortunately I'm not seeing any evidence of this query running. In an > attempt to troubleshoot I reduced the group by and resample intervals down > to an hour. I was very surprised to find that the continuous query is > running exactly as I intended. > > CREATE CONTINUOUS QUERY tablespace_utilization_test_hr ON telegraf > RESAMPLE EVERY 1h FOR 2h BEGIN SELECT max(bytes) AS bytes INTO > telegraf.autogen.tu_test_hr FROM telegraf.autogen.tablespace_utilization > GROUP BY time(1h), collection_host, "database", tablespace_name, owner END > > > Data is being inserted into the 'tablespace_utilization' measurement every > 5 minutes. I have verified that data does exist within the time interval, > and no evidence of the query running is ever found in the influxdb log. Are > there any known issues with resampling periods of over 1 day? I'm stumped > and would appreciate any insight someone could provide. > > Thank you, > Ryan > > -- > Remember to include the version number! > --- > You received this message because you are subscribed to the Google Groups > "InfluxData" 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/437233bb-8292-4ced-896c-bb797bc86fb9%40googlegroups.com > <https://groups.google.com/d/msgid/influxdb/437233bb-8292-4ced-896c-bb797bc86fb9%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Remember to include the version number! --- You received this message because you are subscribed to the Google Groups "InfluxData" 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/CAHRno_wPDicyf9zrarh6fi3geAzRHPKcuGseoo%3DZ%2Bo14Wpq0sQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
