Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align downsampling intervals to the Gregorian calendar.
This feature supports the alignment of downsampling intervals to the Gregorian calendar based on four different time categories: - DAILY: The start time of each interval is computed as the start of the day in which the first data point occurs, based on a specified time zone (or the default JVM time zone, if no time zone has been specified). The end time of each interval is computed as the end of the day in which the first data point occurs. For instance, if the specified time zone is UTC, and the timestamp of the first data point is 2016-01-05T05:32:00Z, then start of the interval will be computed as 2016-01-05T00:00:00.000Z, while the end of the interval will be computed as 2016-01-05T23:59:59.999Z. - WEEKLY: The start time of each interval is computed as the start of the week in which the first data point occurs, based on a specified time zone (or the default JVM time zone, if no time zone has been specified). The end time of each interval is computed as the end of the week in which the first data point occurs. Weeks are considered to begin on Sundays (in the future, it might be a good idea to allow for variations based on a configuration setting). For instance, if the specified time zone is UTC, and the timestamp of the first data point is 2016-01-05T05:32:00Z, then start of the interval will be computed as 2016-01-03T00:00:00.000Z, while the end of the interval will be computed as 2016-01-09T23:59:59.999Z. - MONTHLY: The start time of each interval is computed as the start of the month in which the first data point occurs, based on a specified time zone (or the default JVM time zone, if no time zone has been specified). The end time of each interval is computed as the end of the month in which the first data point occurs. For instance, if the specified time zone is UTC, and the timestamp of the first data point is 2016-01-05T05:32:00Z, then start of the interval will be computed as 2016-01-01T00:00:00.000Z, while the end of the interval will be computed as 2016-01-31T23:59:59.999Z. - YEARLY: The start time of each interval is computed as the start of the year in which the first data point occurs, based on a specified time zone (or the default JVM time zone, if no time zone has been specified). The end time of each interval is computed as the end of the year in which the first data point occurs. For instance, if the specified time zone is UTC, and the timestamp of the first data point is 2016-01-05T05:32:00Z, then start of the interval will be computed as 2016-01-01T00:00:00.000Z, while the end of the interval will be computed as 2016-12-31T23:59:59.999Z. This feature also allows for the alignment of intervals that are multiples of one year, one month, one week, or one day. In cases where a given interval is a multiple of more than one time category, the larger time category will be used. For instance, an interval of 24 months will be interpreted as a interval of two years, and will be aligned to the calendar accordingly. As such, if the specified time zone is UTC, and the timestamp of the first data point is 2016-03-05T05:32:00Z, then start of the interval will be computed as 2016-01-01T00:00:00.000Z, while the end of the interval will be computed as 2017-12-31T23:59:59.999Z. This is in keeping with the principle of least astonishment. To specify the time zone for a given HTTP query, include a query string parameter named "tz" with a value equal to a JVM time zone id (e.g. "UTC"). If a time zone is not included in the query string, the default JVM time zone will be used. To specify that a given HTTP query should use the calendar alignment feature for downsampling, include a query string parameter named "use_calendar" with a value of "true". You can stipulate that all HTTP queries should use the calendar alignment feature by including a "tsd.query.downsample.use_calendar" configuration setting within the opentsdb.conf file and by setting its value to "true" (the default value is "false"). This config file setting can be overridden on a per-query basis by including the "use_calendar" parameter in the query string as specified above.
- Loading branch information