kvrocks icon indicating copy to clipboard operation
kvrocks copied to clipboard

feat(ts): add the support of TWA aggregator to Range and MRange

Open var-nan opened this issue 2 months ago • 6 comments

It closes #3217 . rangeCommon() in redis_timeseries.cc will add two samples, prev_sample and next_sample to the res vector when the aggregator is twa. These two samples are used to compute the area of the polygons that are at the front of the first bucket and at the end of last bucket.

prev_sample is the biggest sample in the data with timestamp less than or equal to first sample of filtered range and next_sample is the smallest sample in the data with timestamp greater than or equal to the last sample of filtered range.

TODO: test TWA with FILTER_BY_TS/FILTER_BY_VALUE option.

var-nan avatar Nov 15 '25 05:11 var-nan