Skip to content

Commit 801a041

Browse files
authored
IGNORE - doc updates (#311)
* IGNORE - doc updates * Update index.md * Update index.md * Update index.md * Update index.md * Update index.md * Update index.md * Update index.md * Update index.md * Update index.md * Update index.md * Update index.md * Update index.md * Update index.md
1 parent e84a686 commit 801a041

File tree

7 files changed

+68
-65
lines changed

7 files changed

+68
-65
lines changed

content/commands/ts.add/index.md

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -182,22 +182,12 @@ This argument has no effect when a new time series is created by this command.
182182

183183
is the policy for handling duplicate samples. A new sample is considered a duplicate and is ignored if the following conditions are met:
184184

185-
- The difference of the current timestamp from the previous timestamp (`timestamp - max_timestamp`) is less than or equal to `ignoreMaxTimeDiff`;
186-
- The absolute value difference of the current value from the value at the previous maximum timestamp (`abs(value - value_at_max_timestamp`) is less than or equal to `ignoreMaxValDiff`;
187-
- The sample is added in-order (`timestamp ≥ max_timestamp`).
188-
189-
This can be expressed algorithmically as follows:
190-
191-
```
192-
if ((series is not a compaction) &&
193-
(series' DUPLICATE_POLICY == LAST) &&
194-
(timestamp ≥ max_timestamp) &&
195-
(timestamp - max_timestamp ≤ ignoreMaxTimeDiff) &&
196-
abs(value - value_at_max_timestamp) ≤ ignoreMaxValDiff))
197-
198-
ignore sample
199-
```
200-
185+
- The time series is not a compaction;
186+
- The time series' `DUPLICATE_POLICY` IS `LAST`;
187+
- The sample is added in-order (`timestamp ≥ max_timestamp`);
188+
- The difference of the current timestamp from the previous timestamp (`timestamp - max_timestamp`) is less than or equal to `IGNORE_MAX_TIME_DIFF`;
189+
- The absolute value difference of the current value from the value at the previous maximum timestamp (`abs(value - value_at_max_timestamp`) is less than or equal to `IGNORE_MAX_VAL_DIFF`.
190+
201191
where `max_timestamp` is the timestamp of the sample with the largest timestamp in the time series, and `value_at_max_timestamp` is the value at `max_timestamp`.
202192

203193
When not specified: set to the global [IGNORE_MAX_TIME_DIFF]({{< baseurl >}}/develop/data-types/timeseries/configuration#ignore_max_time_diff-and-ignore_max_val_diff) and [IGNORE_MAX_VAL_DIFF]({{< baseurl >}}/develop/data-types/timeseries/configuration#ignore_max_time_diff-and-ignore_max_val_diff), which are, by default, both set to 0.
@@ -215,15 +205,15 @@ Use it only if you are creating a new time series. It is ignored if you are addi
215205

216206
<note><b>Notes:</b>
217207
- You can use this command to create a new time series and add data to it in a single command.
218-
`RETENTION`, `ENCODING`, `CHUNK_SIZE`, `DUPLICATE_POLICY`, and `LABELS` are used only when creating a new time series, and ignored when adding samples to an existing time series.
208+
`RETENTION`, `ENCODING`, `CHUNK_SIZE`, `DUPLICATE_POLICY`, `IGNORE`, and `LABELS` are used only when creating a new time series, and ignored when adding samples to an existing time series.
219209
- Setting `RETENTION` and `LABELS` introduces additional time complexity.
220210
</note>
221211

222212
## Return value
223213

224214
Returns one of these replies:
225215

226-
- [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) - the timestamp of the upserted sample. For an element that is ignored (see the `IGNORE` parameter above), the value will be `max_timestamp`.
216+
- [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) - the timestamp of the upserted sample. If the sample is ignored (See `IGNORE` in [`TS.CREATE`]({{< baseurl >}}/commands/ts.create/)), the reply will be the largest timestamp in the time series.
227217
- [] on error (invalid arguments, wrong key type, etc.), when duplication policy is `BLOCK`, or when `timestamp` is older than the retention period compared to the maximum existing timestamp
228218

229219
## Complexity

content/commands/ts.alter/index.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ stack_path: docs/data-types/timeseries
6565
summary: Update the retention, chunk size, duplicate policy, and labels of an existing
6666
time series
6767
syntax: "TS.ALTER key \n [RETENTION retentionPeriod] \n [CHUNK_SIZE size] \n [DUPLICATE_POLICY\
68-
\ policy] \n [IGNORE ignoreMaxTimediff ignoreMaxValDiff] [LABELS [label value ...]]\n"
68+
\ policy] \n [IGNORE ignoreMaxTimediff ignoreMaxValDiff] \n [LABELS [label value ...]]\n"
6969
syntax_fmt: "TS.ALTER key [RETENTION\_retentionPeriod] [CHUNK_SIZE\_size]\n [DUPLICATE_POLICY\_\
70-
<BLOCK | FIRST | LAST | MIN | MAX | SUM>]\n [IGNORE ignoreMaxTimediff ignoreMaxValDiff] [LABELS\ [label value ...]]"
70+
<BLOCK | FIRST | LAST | MIN | MAX | SUM>]\n [IGNORE ignoreMaxTimediff ignoreMaxValDiff] \n [LABELS\ [label value ...]]"
7171
syntax_str: "[RETENTION\_retentionPeriod] [CHUNK_SIZE\_size] [DUPLICATE_POLICY\_<BLOCK\
7272
\ | FIRST | LAST | MIN | MAX | SUM>] [IGNORE ignoreMaxTimediff ignoreMaxValDiff] [LABELS\ [label value ...]]"
7373
title: TS.ALTER
@@ -105,15 +105,7 @@ is policy for handling multiple samples with identical timestamps. See `DUPLICAT
105105

106106
<details open><summary><code>IGNORE ignoreMaxTimediff ignoreMaxValDiff</code></summary>
107107

108-
is the policy for handling duplicate samples. A new sample is considered a duplicate and is ignored if the following conditions are met:
109-
110-
- The difference of the current timestamp from the previous timestamp (`timestamp - max_timestamp`) is less than or equal to `ignoreMaxTimeDiff`;
111-
- The absolute value difference of the current value from the value at the previous maximum timestamp (`abs(value - value_at_max_timestamp`) is less than or equal to `ignoreMaxValDiff`;
112-
- The sample is added in-order (`timestamp ≥ max_timestamp`).
113-
114-
When not specified: set to the global [IGNORE_MAX_TIME_DIFF]({{< baseurl >}}/develop/data-types/timeseries/configuration#ignore_max_time_diff-and-ignore_max_val_diff) and [IGNORE_MAX_VAL_DIFF]({{< baseurl >}}/develop/data-types/timeseries/configuration#ignore_max_time_diff-and-ignore_max_val_diff), which are, by default, both set to 0.
115-
116-
See [`TS.ADD`]({{< baseurl >}}/commands/ts.add/) for more details.
108+
is the policy for handling duplicate samples. See `IGNORE` in [`TS.CREATE`]({{< baseurl >}}/commands/ts.create/).
117109
</details>
118110

119111
<details open><summary><code>LABELS [{label value}...]</code></summary>

content/commands/ts.create/index.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,15 @@ is policy for handling insertion ([`TS.ADD`]({{< baseurl >}}/commands/ts.add/) a
155155

156156
is the policy for handling duplicate samples. A new sample is considered a duplicate and is ignored if the following conditions are met:
157157

158-
- The difference of the current timestamp from the previous timestamp (`timestamp - max_timestamp`) is less than or equal to `ignoreMaxTimeDiff`;
159-
- The absolute value difference of the current value from the value at the previous maximum timestamp (`abs(value - value_at_max_timestamp`) is less than or equal to `ignoreMaxValDiff`;
160-
- The sample is added in-order (`timestamp ≥ max_timestamp`).
158+
- The time series is not a compaction;
159+
- The time series' `DUPLICATE_POLICY` IS `LAST`;
160+
- The sample is added in-order (`timestamp ≥ max_timestamp`);
161+
- The difference of the current timestamp from the previous timestamp (`timestamp - max_timestamp`) is less than or equal to `IGNORE_MAX_TIME_DIFF`;
162+
- The absolute value difference of the current value from the value at the previous maximum timestamp (`abs(value - value_at_max_timestamp`) is less than or equal to `IGNORE_MAX_VAL_DIFF`.
163+
164+
where `max_timestamp` is the timestamp of the sample with the largest timestamp in the time series, and `value_at_max_timestamp` is the value at `max_timestamp`.
161165

162166
When not specified: set to the global [IGNORE_MAX_TIME_DIFF]({{< baseurl >}}/develop/data-types/timeseries/configuration#ignore_max_time_diff-and-ignore_max_val_diff) and [IGNORE_MAX_VAL_DIFF]({{< baseurl >}}/develop/data-types/timeseries/configuration#ignore_max_time_diff-and-ignore_max_val_diff), which are, by default, both set to 0.
163-
164-
See [`TS.ADD`]({{< baseurl >}}/commands/ts.add/) for more details.
165167
</details>
166168

167169
<details open><summary><code>LABELS {label value}...</code></summary>

content/commands/ts.decrby/index.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ is numeric value of the subtrahend (double).
9292
<note><b>Notes</b>
9393
- When specified key does not exist, a new time series is created.
9494
- You can use this command as a counter or gauge that automatically gets history as a time series.
95+
- If a policy for handling duplicate samples (`IGNORE`) is defined for this time series - `TS.DECRBY` operations are affected as well (sample additions/modifications can be filtered).
9596
- Explicitly adding samples to a compacted time series (using [`TS.ADD`]({{< baseurl >}}/commands/ts.add/), [`TS.MADD`]({{< baseurl >}}/commands/ts.madd/), [`TS.INCRBY`]({{< baseurl >}}/commands/ts.incrby/), or `TS.DECRBY`) may result in inconsistencies between the raw and the compacted data. The compaction process may override such samples.
9697
</note>
9798

@@ -142,13 +143,17 @@ Use it only if you are creating a new time series. It is ignored if you are addi
142143

143144
is the policy for handling duplicate samples. A new sample is considered a duplicate and is ignored if the following conditions are met:
144145

145-
- The difference of the current timestamp from the previous timestamp (`timestamp - max_timestamp`) is less than or equal to `ignoreMaxTimeDiff`;
146-
- The absolute value difference of the current value from the value at the previous maximum timestamp (`abs(value - value_at_max_timestamp`) is less than or equal to `ignoreMaxValDiff`;
147-
- The sample is added in-order (`timestamp ≥ max_timestamp`).
146+
- The time series is not a compaction;
147+
- The time series' `DUPLICATE_POLICY` IS `LAST`;
148+
- The sample is added in-order (`timestamp ≥ max_timestamp`);
149+
- The difference of the current timestamp from the previous timestamp (`timestamp - max_timestamp`) is less than or equal to `IGNORE_MAX_TIME_DIFF`;
150+
- The absolute value difference of the current value from the value at the previous maximum timestamp (`abs(value - value_at_max_timestamp`) is less than or equal to `IGNORE_MAX_VAL_DIFF`.
151+
152+
where `max_timestamp` is the timestamp of the sample with the largest timestamp in the time series, and `value_at_max_timestamp` is the value at `max_timestamp`.
148153

149154
When not specified: set to the global [IGNORE_MAX_TIME_DIFF]({{< baseurl >}}/develop/data-types/timeseries/configuration#ignore_max_time_diff-and-ignore_max_val_diff) and [IGNORE_MAX_VAL_DIFF]({{< baseurl >}}/develop/data-types/timeseries/configuration#ignore_max_time_diff-and-ignore_max_val_diff), which are, by default, both set to 0.
150155

151-
These parameters are used when creating a new time series to set the per-key parameters, and are ignored when called with an existing time series (the existing per-key configuration parameters is used).
156+
These parameters are used when creating a new time series to set the per-key parameters, and are ignored when called with an existing time series (the existing per-key configuration parameters are used).
152157
</details>
153158

154159
<details open><summary><code>LABELS [{label value}...]</code></summary>
@@ -159,16 +164,16 @@ Use it only if you are creating a new time series. It is ignored if you are addi
159164
</details>
160165

161166
<note><b>Notes</b>
162-
163-
- You can use this command to add data to a nonexisting time series in a single command. This is why `RETENTION`, `ENCODING`, `CHUNK_SIZE`, `DUPLICATE_POLICY`, and `LABELS` are optional arguments.
164-
- When specified and the key doesn't exist, a new time series is created. Setting the `RETENTION` and `LABELS` introduces additional time complexity.
167+
- You can use this command to create a new time series and add a sample to it in a single command.
168+
`RETENTION`, `ENCODING`, `CHUNK_SIZE`, `DUPLICATE_POLICY`, `IGNORE`, and `LABELS` are used only when creating a new time series, and ignored when adding or modifying samples in an existing time series.
169+
- Setting `RETENTION` and `LABELS` introduces additional time complexity.
165170
</note>
166171

167172
## Return value
168173

169174
Returns one of these replies:
170175

171-
- [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) - the timestamp of the upserted sample
176+
- [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) - the timestamp of the upserted sample. If the sample is ignored (See `IGNORE` in [`TS.CREATE`]({{< baseurl >}}/commands/ts.create/)), the reply will be the largest timestamp in the time series.
172177
- [] on error (invalid arguments, wrong key type, etc.), or when `timestamp` is not equal to or higher than the maximum existing timestamp
173178

174179
## See also

content/commands/ts.incrby/index.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ is numeric value of the addend (double).
9393
<note><b>Notes</b>
9494
- When specified key does not exist, a new time series is created.
9595
- You can use this command as a counter or gauge that automatically gets history as a time series.
96+
- If a policy for handling duplicate samples (`IGNORE`) is defined for this time series - `TS.INCRBY` operations are affected as well (sample additions/modifications can be filtered).
9697
- Explicitly adding samples to a compacted time series (using [`TS.ADD`]({{< baseurl >}}/commands/ts.add/), [`TS.MADD`]({{< baseurl >}}/commands/ts.madd/), `TS.INCRBY`, or [`TS.DECRBY`]({{< baseurl >}}/commands/ts.decrby/)) may result in inconsistencies between the raw and the compacted data. The compaction process may override such samples.
9798
</note>
9899

@@ -104,7 +105,7 @@ is Unix time (integer, in milliseconds) specifying the sample timestamp or `*` t
104105

105106
Unix time is the number of milliseconds that have elapsed since 00:00:00 UTC on 1 January 1970, the Unix epoch, without adjustments made due to leap seconds.
106107

107-
`timestamp` must be equal to or higher than the maximum existing timestamp. When equal, the value of the sample with the maximum existing timestamp is increased. If it is higher, a new sample with a timestamp set to `timestamp` is created, and its value is set to the value of the sample with the maximum existing timestamp plus `addend`.
108+
`timestamp` must be equal to or higher than the maximum existing timestamp. When equal, the value of the sample with the maximum existing timestamp is increased. If it is higher, a new sample with a timestamp set to `timestamp` is created, and its value is set to the value of the sample with the maximum existing timestamp plus `addend`.
108109

109110
If the time series is empty, the value is set to `addend`.
110111

@@ -143,13 +144,17 @@ Use it only if you are creating a new time series. It is ignored if you are addi
143144

144145
is the policy for handling duplicate samples. A new sample is considered a duplicate and is ignored if the following conditions are met:
145146

146-
- The difference of the current timestamp from the previous timestamp (`timestamp - max_timestamp`) is less than or equal to `ignoreMaxTimeDiff`;
147-
- The absolute value difference of the current value from the value at the previous maximum timestamp (`abs(value - value_at_max_timestamp`) is less than or equal to `ignoreMaxValDiff`;
148-
- The sample is added in-order (`timestamp ≥ max_timestamp`).
147+
- The time series is not a compaction;
148+
- The time series' `DUPLICATE_POLICY` IS `LAST`;
149+
- The sample is added in-order (`timestamp ≥ max_timestamp`);
150+
- The difference of the current timestamp from the previous timestamp (`timestamp - max_timestamp`) is less than or equal to `IGNORE_MAX_TIME_DIFF`;
151+
- The absolute value difference of the current value from the value at the previous maximum timestamp (`abs(value - value_at_max_timestamp`) is less than or equal to `IGNORE_MAX_VAL_DIFF`.
152+
153+
where `max_timestamp` is the timestamp of the sample with the largest timestamp in the time series, and `value_at_max_timestamp` is the value at `max_timestamp`.
149154

150155
When not specified: set to the global [IGNORE_MAX_TIME_DIFF]({{< baseurl >}}/develop/data-types/timeseries/configuration#ignore_max_time_diff-and-ignore_max_val_diff) and [IGNORE_MAX_VAL_DIFF]({{< baseurl >}}/develop/data-types/timeseries/configuration#ignore_max_time_diff-and-ignore_max_val_diff), which are, by default, both set to 0.
151156

152-
These parameters are used when creating a new time series to set the per-key parameters, and are ignored when called with an existing time series (the existing per-key configuration parameters is used).
157+
These parameters are used when creating a new time series to set the per-key parameters, and are ignored when called with an existing time series (the existing per-key configuration parameters are used).
153158
</details>
154159

155160
<details open><summary><code>LABELS [{label value}...]</code></summary>
@@ -160,15 +165,16 @@ Use it only if you are creating a new time series. It is ignored if you are addi
160165
</details>
161166

162167
<note><b>Notes</b>
163-
- You can use this command to add data to a nonexisting time series in a single command. This is why `RETENTION`, `ENCODING`, `CHUNK_SIZE`, `DUPLICATE_POLICY`, and `LABELS` are optional arguments.
164-
- When specified and the key doesn't exist, a new time series is created. Setting the `RETENTION` and `LABELS` introduces additional time complexity.
168+
- You can use this command to create a new time series and add a sample to it in a single command.
169+
`RETENTION`, `ENCODING`, `CHUNK_SIZE`, `DUPLICATE_POLICY`, `IGNORE`, and `LABELS` are used only when creating a new time series, and ignored when adding or modifying samples in an existing time series.
170+
- Setting `RETENTION` and `LABELS` introduces additional time complexity.
165171
</note>
166172

167173
## Return value
168174

169175
Returns one of these replies:
170176

171-
- [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) - the timestamp of the upserted sample
177+
- [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) - the timestamp of the upserted sample. If the sample is ignored (See `IGNORE` in [`TS.CREATE`]({{< baseurl >}}/commands/ts.create/)), the reply will be the largest timestamp in the time series.
172178
- [] on error (invalid arguments, wrong key type, etc.), or when `timestamp` is not equal to or higher than the maximum existing timestamp
173179

174180
## Examples

content/commands/ts.madd/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ is numeric data value of the sample (double). The double number should follow <a
7474

7575
Returns one of these replies:
7676

77-
- [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}), where each element is an [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) representing the timestamp of a upserted sample or an [] (when duplication policy is `BLOCK`, or when `timestamp` is older than the retention period compared to the maximum existing timestamp). For each element that is ignored (see the `IGNORE` option to `TS.ADD` for definitions), the element will have the value `max_timestamp`.
77+
- [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}), where each element is an [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) representing the timestamp of a upserted sample or an [] (when duplication policy is `BLOCK`, or when `timestamp` is older than the retention period compared to the maximum existing timestamp). For each element that is ignored (see `IGNORE` in [`TS.CREATE`]({{< baseurl >}}/commands/ts.create/)), the reply element value will be the largest timestamp in the time series.
7878
- [] (invalid arguments, wrong key type, etc.)
7979

8080
## Complexity

0 commit comments

Comments
 (0)