RedisTimeSeries / redistimeseries-go

golang client lib for RedisTimeSeries

Home Page:https://redistimeseries.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for DUPLICATE_POLICY on TS.CREATE and TS.ADD

filipecosta90 opened this issue · comments

As of RedisTimeseries >= 1.4 You can now add samples to a time series where the time of the sample is older than the newest sample in the series. Bundled with that, we now have a policy that will define handling of duplicate samples, and that needs to be supported on the client via the arguments [DUPLICATE_POLICY policy] on TS.CREATE and via [ON_DUPLICATE policy] on TS.ADD. The following are the possible policies:

  • BLOCK - an error will occur for any out of order sample
  • FIRST - ignore the new value
  • LAST - override with latest value
  • MIN - only override if the value is lower than the existing value
  • MAX - only override if the value is higher than the existing value

Further reference: documentation link