You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/commands/ts.add/index.md
+8-18Lines changed: 8 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -182,22 +182,12 @@ This argument has no effect when a new time series is created by this command.
182
182
183
183
is the policy for handling duplicate samples. A new sample is considered a duplicate and is ignored if the following conditions are met:
184
184
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`).
- 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
+
201
191
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`.
202
192
203
193
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
215
205
216
206
<note><b>Notes:</b>
217
207
- 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.
219
209
- Setting `RETENTION` and `LABELS` introduces additional time complexity.
220
210
</note>
221
211
222
212
## Return value
223
213
224
214
Returns one of these replies:
225
215
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.
227
217
-[] 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
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/).
Copy file name to clipboardExpand all lines: content/commands/ts.create/index.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -155,13 +155,15 @@ is policy for handling insertion ([`TS.ADD`]({{< baseurl >}}/commands/ts.add/) a
155
155
156
156
is the policy for handling duplicate samples. A new sample is considered a duplicate and is ignored if the following conditions are met:
157
157
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`.
161
165
162
166
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.
Copy file name to clipboardExpand all lines: content/commands/ts.decrby/index.md
+13-8Lines changed: 13 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,7 @@ is numeric value of the subtrahend (double).
92
92
<note><b>Notes</b>
93
93
- When specified key does not exist, a new time series is created.
94
94
- 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).
95
96
- 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.
96
97
</note>
97
98
@@ -142,13 +143,17 @@ Use it only if you are creating a new time series. It is ignored if you are addi
142
143
143
144
is the policy for handling duplicate samples. A new sample is considered a duplicate and is ignored if the following conditions are met:
144
145
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`.
148
153
149
154
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.
150
155
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).
@@ -159,16 +164,16 @@ Use it only if you are creating a new time series. It is ignored if you are addi
159
164
</details>
160
165
161
166
<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.
165
170
</note>
166
171
167
172
## Return value
168
173
169
174
Returns one of these replies:
170
175
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.
172
177
-[] on error (invalid arguments, wrong key type, etc.), or when `timestamp` is not equal to or higher than the maximum existing timestamp
Copy file name to clipboardExpand all lines: content/commands/ts.incrby/index.md
+14-8Lines changed: 14 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,6 +93,7 @@ is numeric value of the addend (double).
93
93
<note><b>Notes</b>
94
94
- When specified key does not exist, a new time series is created.
95
95
- 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).
96
97
- 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.
97
98
</note>
98
99
@@ -104,7 +105,7 @@ is Unix time (integer, in milliseconds) specifying the sample timestamp or `*` t
104
105
105
106
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.
106
107
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`.
108
109
109
110
If the time series is empty, the value is set to `addend`.
110
111
@@ -143,13 +144,17 @@ Use it only if you are creating a new time series. It is ignored if you are addi
143
144
144
145
is the policy for handling duplicate samples. A new sample is considered a duplicate and is ignored if the following conditions are met:
145
146
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`.
149
154
150
155
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.
151
156
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).
@@ -160,15 +165,16 @@ Use it only if you are creating a new time series. It is ignored if you are addi
160
165
</details>
161
166
162
167
<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.
165
171
</note>
166
172
167
173
## Return value
168
174
169
175
Returns one of these replies:
170
176
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.
172
178
-[] on error (invalid arguments, wrong key type, etc.), or when `timestamp` is not equal to or higher than the maximum existing timestamp
Copy file name to clipboardExpand all lines: content/commands/ts.madd/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ is numeric data value of the sample (double). The double number should follow <a
74
74
75
75
Returns one of these replies:
76
76
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.
0 commit comments