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
DEV: add RESP2/3 return information to the time series commands (#1895)
* DEV: add RESP2/3 return information to the time series commands
* Apply suggestions from code review
Co-authored-by: andy-stark-redis <164213578+andy-stark-redis@users.noreply.github.com>
* Apply more suggestions from code review
---------
Co-authored-by: andy-stark-redis <164213578+andy-stark-redis@users.noreply.github.com>
Copy file name to clipboardExpand all lines: content/commands/ts.add.md
+18-7Lines changed: 18 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -213,13 +213,6 @@ Use it only if you are creating a new time series. It is ignored if you are addi
213
213
- Setting `RETENTION` and `LABELS` introduces additional time complexity.
214
214
</note>
215
215
216
-
## Return value
217
-
218
-
Returns one of these replies:
219
-
220
-
-[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) - the timestamp of the upserted sample. If the sample is ignored (See `IGNORE` in [`TS.CREATE`]({{< relref "commands/ts.create/" >}})), the reply will be the largest timestamp in the time series.
221
-
-[] 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
222
-
223
216
## Complexity
224
217
225
218
If a compaction rule exists on a time series, the performance of `TS.ADD` can be reduced.
@@ -246,6 +239,24 @@ Add a sample to the time series, setting the sample's timestamp to the current U
246
239
{{< / highlight >}}
247
240
</details>
248
241
242
+
## Return information
243
+
244
+
{{< multitabs id="ts-add-return-info"
245
+
tab1="RESP2"
246
+
tab2="RESP3" >}}
247
+
248
+
One of the following:
249
+
*[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): the timestamp of the upserted sample. If the sample is ignored (see `IGNORE` in [`TS.CREATE`]({{< relref "commands/ts.create/" >}})), the reply will be the largest timestamp in the time series.
250
+
*[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, duplication policy is `BLOCK`, or when `timestamp` is older than the retention period compared to the maximum existing timestamp.
251
+
252
+
-tab-sep-
253
+
254
+
One of the following:
255
+
*[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): the timestamp of the upserted sample. If the sample is ignored (see `IGNORE` in [`TS.CREATE`]({{< relref "commands/ts.create/" >}})), the reply will be the largest timestamp in the time series.
256
+
*[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, duplication policy is `BLOCK`, or when `timestamp` is older than the retention period compared to the maximum existing timestamp.
Copy file name to clipboardExpand all lines: content/commands/ts.alter.md
+18-7Lines changed: 18 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,13 +119,6 @@ is set of label-value pairs that represent metadata labels of the key and serve
119
119
If `LABELS` is specified, the given label list is applied. Labels that are not present in the given list are removed implicitly. Specifying `LABELS` with no label-value pairs removes all existing labels. See `LABELS` in [`TS.CREATE`]({{< relref "commands/ts.create/" >}}).
-[] on error (invalid arguments, wrong key type, key does not exist, etc.)
128
-
129
122
## Examples
130
123
131
124
<detailsopen><summary><b>Alter a temperature time series</b></summary>
@@ -145,6 +138,24 @@ OK
145
138
{{< / highlight >}}
146
139
</details>
147
140
141
+
## Return information
142
+
143
+
{{< multitabs id="ts-alter-return-info"
144
+
tab1="RESP2"
145
+
tab2="RESP3" >}}
146
+
147
+
One of the following:
148
+
*[Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` when the time series is altered successfully.
149
+
*[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, key does not exist, etc.
150
+
151
+
-tab-sep-
152
+
153
+
One of the following:
154
+
*[Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` when the time series is altered successfully.
155
+
*[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, key does not exist, etc.
Copy file name to clipboardExpand all lines: content/commands/ts.create.md
+19-8Lines changed: 19 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -180,14 +180,7 @@ is set of label-value pairs that represent metadata labels of the key and serve
180
180
The [`TS.MGET`]({{< relref "commands/ts.mget/" >}}), [`TS.MRANGE`]({{< relref "commands/ts.mrange/" >}}), and [`TS.MREVRANGE`]({{< relref "commands/ts.mrevrange/" >}}) commands operate on multiple time series based on their labels. The [`TS.QUERYINDEX`]({{< relref "commands/ts.queryindex/" >}}) command returns all time series keys matching a given filter based on their labels.
Copy file name to clipboardExpand all lines: content/commands/ts.createrule.md
+19-8Lines changed: 19 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,13 +151,6 @@ ensures that there is a bucket that starts exactly at `alignTimestamp` and align
151
151
For example, if `bucketDuration` is 24 hours (`24 * 3600 * 1000`), setting `alignTimestamp` to 6 hours after the Unix epoch (`6 * 3600 * 1000`) ensures that each bucket’s timeframe is `[06:00 .. 06:00)`.
-[] on error (invalid arguments, wrong key type, etc.), when `sourceKey` does not exist, when `destKey` does not exist, when `sourceKey` is already a destination of a compaction rule, when `destKey` is already a source or a destination of a compaction rule, or when `sourceKey` and `destKey` are identical
160
-
161
154
## Examples
162
155
163
156
<detailsopen>
@@ -184,9 +177,27 @@ Now, also create a compacted time series named _dailyDiffTemp_. This time series
184
177
127.0.0.1:6379> TS.CREATE dailyDiffTemp:TLV LABELS type temp location TLV
185
178
127.0.0.1:6379> TS.CREATERULE temp:TLV dailyDiffTemp:TLV AGGREGATION range 86400000 21600000
186
179
{{< / highlight >}}
187
-
180
+
188
181
</details>
189
182
183
+
## Return information
184
+
185
+
{{< multitabs id="ts-createrule-return-info"
186
+
tab1="RESP2"
187
+
tab2="RESP3" >}}
188
+
189
+
One of the following:
190
+
*[Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` when the compaction rule is created successfully.
191
+
*[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, `sourceKey` does not exist, `destKey` does not exist, `sourceKey` is already a destination of a compaction rule, `destKey` is already a source or a destination of a compaction rule, or `sourceKey` and `destKey` are identical.
192
+
193
+
-tab-sep-
194
+
195
+
One of the following:
196
+
*[Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` when the compaction rule is created successfully.
197
+
*[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, `sourceKey` does not exist, `destKey` does not exist, `sourceKey` is already a destination of a compaction rule, `destKey` is already a source or a destination of a compaction rule, or `sourceKey` and `destKey` are identical.
Copy file name to clipboardExpand all lines: content/commands/ts.decrby.md
+15-4Lines changed: 15 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -173,12 +173,23 @@ Use it only if you are creating a new time series. It is ignored if you are addi
173
173
- Setting `RETENTION` and `LABELS` introduces additional time complexity.
174
174
</note>
175
175
176
-
## Return value
176
+
## Return information
177
177
178
-
Returns one of these replies:
178
+
{{< multitabs id="ts-decrby-return-info"
179
+
tab1="RESP2"
180
+
tab2="RESP3" >}}
179
181
180
-
-[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) - the timestamp of the upserted sample. If the sample is ignored (See `IGNORE` in [`TS.CREATE`]({{< relref "commands/ts.create/" >}})), the reply will be the largest timestamp in the time series.
181
-
-[] on error (invalid arguments, wrong key type, etc.), or when `timestamp` is not equal to or higher than the maximum existing timestamp
182
+
One of the following:
183
+
*[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): the timestamp of the upserted sample. If the sample is ignored (see `IGNORE` in [`TS.CREATE`]({{< relref "commands/ts.create/" >}})), the reply will be the largest timestamp in the time series.
184
+
*[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, or when `timestamp` is not equal to or higher than the maximum existing timestamp.
185
+
186
+
-tab-sep-
187
+
188
+
One of the following:
189
+
*[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): the timestamp of the upserted sample. If the sample is ignored (see `IGNORE` in [`TS.CREATE`]({{< relref "commands/ts.create/" >}})), the reply will be the largest timestamp in the time series.
190
+
*[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, or when `timestamp` is not equal to or higher than the maximum existing timestamp.
Copy file name to clipboardExpand all lines: content/commands/ts.del.md
+19-8Lines changed: 19 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,14 +69,7 @@ The given timestamp interval is closed (inclusive), meaning that samples whose t
69
69
70
70
</note>
71
71
72
-
## Return value
73
-
74
-
Returns one of these replies:
75
-
76
-
-[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) - the number of samples that were deleted
77
-
-[] on error (invalid arguments, wrong key type, etc.), when `timestamp` is older than the retention period compared to the maximum existing timestamp, or when an affected compaction bucket cannot be recalculated
78
-
79
-
## Examples
72
+
## Examples
80
73
81
74
<detailsopen><summary><b>Delete range of data points</b></summary>
82
75
@@ -107,6 +100,24 @@ Delete the range of data points for temperature in Tel Aviv.
107
100
{{< / highlight >}}
108
101
</details>
109
102
103
+
## Return information
104
+
105
+
{{< multitabs id="ts-del-return-info"
106
+
tab1="RESP2"
107
+
tab2="RESP3" >}}
108
+
109
+
One of the following:
110
+
*[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): the number of samples that were deleted.
111
+
*[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, `timestamp` is older than the retention period compared to the maximum existing timestamp, or when an affected compaction bucket cannot be recalculated.
112
+
113
+
-tab-sep-
114
+
115
+
One of the following:
116
+
*[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): the number of samples that were deleted.
117
+
*[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, `timestamp` is older than the retention period compared to the maximum existing timestamp, or when an affected compaction bucket cannot be recalculated.
-[] on error (invalid arguments, etc.), or when such rule does not exist
60
+
One of the following:
61
+
*[Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` when the compaction rule is deleted successfully.
62
+
*[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, or when such rule does not exist.
63
+
64
+
-tab-sep-
65
+
66
+
One of the following:
67
+
*[Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` when the compaction rule is deleted successfully.
68
+
*[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, or when such rule does not exist.
Copy file name to clipboardExpand all lines: content/commands/ts.get.md
+21-9Lines changed: 21 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,14 +55,6 @@ is used when a time series is a compaction. With `LATEST`, TS.GET reports the co
55
55
The data in the latest bucket of a compaction is possibly partial. A bucket is _closed_ and compacted only upon arrival of a new sample that _opens_ a new _latest_ bucket. There are cases, however, when the compacted value of the latest (possibly partial) bucket is also required. In such a case, use `LATEST`.
56
56
</details>
57
57
58
-
## Return value
59
-
60
-
Returns one of these replies:
61
-
62
-
-[Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of a single ([Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}), [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}})) pair representing (timestamp, value(double)) of the sample with the highest timestamp
63
-
- An empty [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) - when the time series is empty
64
-
-[] (invalid arguments, wrong key type, key does not exist, etc.)
65
-
66
58
## Examples
67
59
68
60
<detailsopen>
@@ -135,7 +127,27 @@ Get the latest maximum daily temperature (the temperature with the highest times
135
127
{{< / highlight >}}
136
128
137
129
</details>
138
-
130
+
131
+
## Return information
132
+
133
+
{{< multitabs id="ts-get-return-info"
134
+
tab1="RESP2"
135
+
tab2="RESP3" >}}
136
+
137
+
One of the following:
138
+
*[Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of a single ([Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}), [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}})) pair representing (timestamp, value) of the sample with the highest timestamp.
139
+
* An empty [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) when the time series is empty.
140
+
*[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, key does not exist, etc.
141
+
142
+
-tab-sep-
143
+
144
+
One of the following:
145
+
*[Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of a single ([Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}), [Double reply]({{< relref "/develop/reference/protocol-spec#doubles" >}})) pair representing (timestamp, value) of the sample with the highest timestamp.
146
+
* An empty [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) when the time series is empty.
147
+
*[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, key does not exist, etc.
Copy file name to clipboardExpand all lines: content/commands/ts.incrby.md
+19-8Lines changed: 19 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,13 +174,6 @@ Use it only if you are creating a new time series. It is ignored if you are addi
174
174
- Setting `RETENTION` and `LABELS` introduces additional time complexity.
175
175
</note>
176
176
177
-
## Return value
178
-
179
-
Returns one of these replies:
180
-
181
-
-[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) - the timestamp of the upserted sample. If the sample is ignored (See `IGNORE` in [`TS.CREATE`]({{< relref "commands/ts.create/" >}})), the reply will be the largest timestamp in the time series.
182
-
-[] on error (invalid arguments, wrong key type, etc.), or when `timestamp` is not equal to or higher than the maximum existing timestamp
183
-
184
177
## Examples
185
178
186
179
<detailsopen><summary><b>Store sum of data from several sources</b></summary>
@@ -215,9 +208,27 @@ Suppose a sensor ticks whenever a car is passed on a road, and you want to count
215
208
(integer) 1658431553109
216
209
{{< / highlight >}}
217
210
218
-
The timestamp is filled automatically.
211
+
The timestamp is filled automatically.
219
212
</details>
220
213
214
+
## Return information
215
+
216
+
{{< multitabs id="ts-incrby-return-info"
217
+
tab1="RESP2"
218
+
tab2="RESP3" >}}
219
+
220
+
One of the following:
221
+
*[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): the timestamp of the upserted sample. If the sample is ignored (see `IGNORE` in [`TS.CREATE`]({{< relref "commands/ts.create/" >}})), the reply will be the largest timestamp in the time series.
222
+
*[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, or when `timestamp` is not equal to or higher than the maximum existing timestamp.
223
+
224
+
-tab-sep-
225
+
226
+
One of the following:
227
+
*[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): the timestamp of the upserted sample. If the sample is ignored (see `IGNORE` in [`TS.CREATE`]({{< relref "commands/ts.create/" >}})), the reply will be the largest timestamp in the time series.
228
+
*[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, or when `timestamp` is not equal to or higher than the maximum existing timestamp.
0 commit comments