This is the first Release Candidate of RedisTimeSeries 1.12
Headlines:
RedisTimeSeries 1.12 adds a highly requested feature: insertion-filter for close samples. Many sensors report data periodically. Often, the difference between the measured value and the previous measured value is negligible and related to random noise or to measurement accuracy limitations. When both the time difference and the value difference between the current and the previous sample are small, it may be preferable to ignore (not to add) the new measurement.
What's new in 1.12
-
#1543 insertion-filter for close samples:
- Two new module configuration parameters are introduced:
IGNORE_MAX_TIME_DIFF
andIGNORE_MAX_VAL_DIFF
. - Two new similar per-key parameters are introduced:
ignoreMaxTimeDiff
andignoreMaxValDiff
. TS.ADD
,TS.INCRBY
, andTS.DECRBY
now have a new optional argument:[IGNORE ignoreMaxTimeDiff ignoreMaxValDiff]
.
When creating a new time series, these two values are used to set the per-key parameters and override the two module configuration parameters. These values are ignored when specified with an existing time series.[IGNORE ignoreMaxTimeDiff ignoreMaxValDiff]
is also supported byTS.ALTER
.- For each call to
TS.ADD
, if the following condition is met: (series is not a compaction), (the series'DUPLICATE_POLICY
isLAST
), (timestamp
≥max_timestamp
), (timestamp
-max_timestamp
≤ignoreMaxTimeDiff
), and abs(value
-value_at_max_timestamp
) ≤ignoreMaxValDiff
)) then this sample is ignored (not added) to the time series.max_timestamp
is the maximal timestamp in the time series. - The same logic also applies for each call to
TS.MADD
based on the values of the per-key parameters. - When a sample is ignored, the returned value for
TS.ADD
and for the applicable array element inTS.MADD
ismax_timestamp
.
- Two new module configuration parameters are introduced:
Notes:
- The version inside Redis will be 1.12.1 in semantic versioning. Since the version of a module in Redis is numeric, we could not add a Release Candidate flag.
- Minimal Redis version: 7.4
- RDB version 8 since 1.12.1. RDB files are not backward-compatible.