From b1359e31437f21f698ebd8b565eb37bc33d7a7e2 Mon Sep 17 00:00:00 2001 From: Lior Kogan Date: Wed, 19 Feb 2025 09:21:25 +0200 Subject: [PATCH 1/3] Small fix to COMPACTION_POLICY --- .../data-types/timeseries/configuration.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/content/develop/data-types/timeseries/configuration.md b/content/develop/data-types/timeseries/configuration.md index 2ae0b96963..f463e7bba4 100644 --- a/content/develop/data-types/timeseries/configuration.md +++ b/content/develop/data-types/timeseries/configuration.md @@ -124,21 +124,21 @@ Each rule is separated by a semicolon (`;`), the rule consists of multiple field * d - day Assure that there is a bucket that starts at exactly _alignTimestamp_ after the epoch and align all other buckets accordingly. Default value: 0 (aligned with the epoch). Example: if _bucketDuration_ is 24 hours, setting _alignTimestamp_ to `6h` (6 hours after the Epoch) will ensure that each bucket’s timeframe is [06:00 .. 06:00). + +Examples: + +- `max:1M:1h` - Aggregate using `max` over one minute and retain the last hour +- `twa:1d:0m:360M` - Aggregate daily [06:00 .. 06:00) using `twa`; no expiration When a compaction policy is defined, compaction rules will be created automatically for newly created time series, and their key would be set to: -* Before RedisTimeSeries v1.8: +* If the time bucket alignment is 0: - _key_dur_agg_ where _key_ is the key of the source time series, _dur_ is the bucket duration, and _agg_ is the aggregator. + _key_agg_dur_ where _key_ is the key of the source time series, _agg_ is the aggregator (in uppercase), and _dur_ is the bucket duration in milliseconds. Example: `key_SUM_60000`. -* Since RedisTimeSeries v1.8: +* If the time bucket alignment is not 0: - _key_dur_agg_aln_ where _key_ is the key of the source time series, _dur_ is the bucket duration, _agg_ is the aggregator, and _aln_ is the alignment timestamp. - -Examples: - -- `max:1M:1h` - Aggregate using `max` over one minute and retain the last hour -- `twa:1d:0m:360M` - Aggregate daily [06:00 .. 06:00) using `twa`; no expiration + _key_agg_dur_aln_ where _key_ is the key of the source time series, _agg_ is the aggregator (in uppercase), _dur_ is the bucket duration in milliseconds, and _aln_ is the time bucket alignment in milliseconds. Example: `key_SUM_60000_1000`. #### Default From c3521033cbc53f3f87adbdc847d8466c728c0e0c Mon Sep 17 00:00:00 2001 From: Lior Kogan Date: Wed, 19 Feb 2025 11:20:55 +0200 Subject: [PATCH 2/3] Update configuration.md --- content/develop/data-types/timeseries/configuration.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/content/develop/data-types/timeseries/configuration.md b/content/develop/data-types/timeseries/configuration.md index f463e7bba4..bb5339b732 100644 --- a/content/develop/data-types/timeseries/configuration.md +++ b/content/develop/data-types/timeseries/configuration.md @@ -125,11 +125,6 @@ Each rule is separated by a semicolon (`;`), the rule consists of multiple field Assure that there is a bucket that starts at exactly _alignTimestamp_ after the epoch and align all other buckets accordingly. Default value: 0 (aligned with the epoch). Example: if _bucketDuration_ is 24 hours, setting _alignTimestamp_ to `6h` (6 hours after the Epoch) will ensure that each bucket’s timeframe is [06:00 .. 06:00). -Examples: - -- `max:1M:1h` - Aggregate using `max` over one minute and retain the last hour -- `twa:1d:0m:360M` - Aggregate daily [06:00 .. 06:00) using `twa`; no expiration - When a compaction policy is defined, compaction rules will be created automatically for newly created time series, and their key would be set to: * If the time bucket alignment is 0: @@ -140,6 +135,11 @@ When a compaction policy is defined, compaction rules will be created automatica _key_agg_dur_aln_ where _key_ is the key of the source time series, _agg_ is the aggregator (in uppercase), _dur_ is the bucket duration in milliseconds, and _aln_ is the time bucket alignment in milliseconds. Example: `key_SUM_60000_1000`. +Examples: + +- `max:1M:1h` - Aggregate using `max` over one minute and retain the last hour +- `twa:1d:0m:360M` - Aggregate daily [06:00 .. 06:00) using `twa`; no expiration + #### Default No compaction rules. From 5e26710afaadd4c165204c030828933b3d7103df Mon Sep 17 00:00:00 2001 From: Lior Kogan Date: Wed, 19 Feb 2025 11:26:00 +0200 Subject: [PATCH 3/3] Update configuration.md --- content/develop/data-types/timeseries/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/develop/data-types/timeseries/configuration.md b/content/develop/data-types/timeseries/configuration.md index bb5339b732..d75de45761 100644 --- a/content/develop/data-types/timeseries/configuration.md +++ b/content/develop/data-types/timeseries/configuration.md @@ -137,7 +137,7 @@ When a compaction policy is defined, compaction rules will be created automatica Examples: -- `max:1M:1h` - Aggregate using `max` over one minute and retain the last hour +- `max:1M:1h` - Aggregate using `max` over one-minute windows and retain the last hour - `twa:1d:0m:360M` - Aggregate daily [06:00 .. 06:00) using `twa`; no expiration #### Default