In azure TSI, we have 3 main query types, getSeries, getEvents, and getAggregate. I am trying to query all of the historical data for many series. I already found out that I must do these queries in a loop, 1 for each series, which is terrible. However, I now need to be able to parse the query with an interval. For example, if I am sending TSI data every 5 seconds and I want to get 1 months worth of data, I don't need every 5 seconds data points. I could do every day instead. If I use getAggregate, with filter: null
and interval: "P1D"
, It returns a ton of null values every 1 day and doesn't return any data. The same thing happens if I reduce this interval to 60M or even 1M. I then used getEvents and it returns all the data points. I could then create a function to parse this but the query speed will be much worse because I would prefer to parse this in the query itself. Is there a way to achieve this?
Ideally, if there is 20 data points, 5 seconds apart and nothing else for that day, it would average these into 1 datapoint for the day. Currently, with getAggregate, it returns null values instead.