3

I am currently using Azure Time Series Insights to aggregate my data. It provides me a way to generate date histogram, where I could specify search span and bucket size. However, the result of buckets does not meet my expectation.

For example, if search span is from 2016-08-01T01:00:00.000Z to 2016-08-0 5T01:00:00.000Z, and bucket size is 1 day, then the result of buckets will be as follows,

from 2016-08-02T00:00:00.000Z to 2016-08-03T00:00:00.000Z,

from 2016-08-03T00:00:00.000Z to 2016-08-04T00:00:00.000Z,

from 2016-08-04T00:00:00.000Z to 2016-08-05T00:00:00.000Z.

I observe two behaviours from the result. First of all, first bucket is not aligned to search span, starting from 2016-08-01T01:00:00.000Z. Secondly, the head and the tail of search span are trunked, namely data from 2016-08-01T01:00:00.000Z to 2016-08-02T00:00:00.000Z and data from 2016-08-05T00:00:00.000Z to 2016-08-05T01:00:00.000Z are not covered.

On the contrary, I would expect first bucket to be aligned with the start of search span, and whole search span to be covered. Currently, I have to calculate buckets in the business logic and query multiple times concurrently, which will quickly reach the limit.

Such behaviour is applied to all time units, like seconds, minutes, hours and days. If I specify bucket size to be 7 days, the result of buckets will be aligned even to Monday.

Since I cannot find any documentation with respect to such behaviour, therefore, my question would be,

If possible, how to get the result as I expected?

If not, what is the recommanded service from Azure to achieve my goal?

1 Answers1

0

This is by design in TSI. The behavior is explained here.

"For a specified search span and interval, this API returns an aggregated response per interval per variable for a Time Series ID. The number of intervals in the response dataset is calculated by counting epoch ticks (the number of milliseconds that have elapsed since Unix epoch - Jan 1st, 1970) and dividing the ticks by the interval span size specified in the query. The timestamps returned in the response set are of the left interval boundaries, not of the sampled events from the interval."

At the moment there isn't a good way to work around this issue, clients will have to handle on their end. This is a known issue and something that TSI has in it's backlog to fix! Please upvote the Feedback item here.

Shreya Sharma
  • 306
  • 1
  • 3