Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions content/commands/ts.add.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,6 @@ Use it only if you are creating a new time series. It is ignored if you are addi
- Setting `RETENTION` and `LABELS` introduces additional time complexity.
</note>

## Return value

Returns one of these replies:

- [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.
- [] 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

## Complexity

If a compaction rule exists on a time series, the performance of `TS.ADD` can be reduced.
Expand All @@ -246,6 +239,24 @@ Add a sample to the time series, setting the sample's timestamp to the current U
{{< / highlight >}}
</details>

## Return information

{{< multitabs id="ts-add-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:
* [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.
* [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.

-tab-sep-

One of the following:
* [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.
* [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.

{{< /multitabs >}}

## See also

[`TS.CREATE`]({{< relref "commands/ts.create/" >}})
Expand Down
25 changes: 18 additions & 7 deletions content/commands/ts.alter.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,6 @@ is set of label-value pairs that represent metadata labels of the key and serve
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/" >}}).
</details>

## Return value

Returns one of these replies:

- [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) - `OK` if executed correctly
- [] on error (invalid arguments, wrong key type, key does not exist, etc.)

## Examples

<details open><summary><b>Alter a temperature time series</b></summary>
Expand All @@ -145,6 +138,24 @@ OK
{{< / highlight >}}
</details>

## Return information

{{< multitabs id="ts-alter-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` when the time series is altered successfully.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, key does not exist, etc.

-tab-sep-

One of the following:
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` when the time series is altered successfully.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, key does not exist, etc.

{{< /multitabs >}}

## See also

[`TS.CREATE`]({{< relref "commands/ts.create/" >}})
Expand Down
27 changes: 19 additions & 8 deletions content/commands/ts.create.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,7 @@ is set of label-value pairs that represent metadata labels of the key and serve
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.
</details>

## Return value

Returns one of these replies:

- [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) - `OK` if executed correctly
- [] on error (invalid arguments, key already exists, etc.)

## Examples
## Examples

<details open><summary><b>Create a temperature time series</b></summary>

Expand All @@ -197,6 +190,24 @@ OK
{{< / highlight >}}
</details>

## Return information

{{< multitabs id="ts-create-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` when the time series is created successfully.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, key already exists, etc.

-tab-sep-

One of the following:
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` when the time series is created successfully.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, key already exists, etc.

{{< /multitabs >}}

## See also

[`TS.ADD`]({{< relref "commands/ts.add/" >}}) | [`TS.INCRBY`]({{< relref "commands/ts.incrby/" >}}) | [`TS.DECRBY`]({{< relref "commands/ts.decrby/" >}}) | [`TS.MGET`]({{< relref "commands/ts.mget/" >}}) | [`TS.MRANGE`]({{< relref "commands/ts.mrange/" >}}) | [`TS.MREVRANGE`]({{< relref "commands/ts.mrevrange/" >}}) | [`TS.QUERYINDEX`]({{< relref "commands/ts.queryindex/" >}})
Expand Down
27 changes: 19 additions & 8 deletions content/commands/ts.createrule.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,6 @@ ensures that there is a bucket that starts exactly at `alignTimestamp` and align
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)`.
</details>

## Return value

Returns one of these replies:

- [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) - `OK` if executed correctly
- [] 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

## Examples

<details open>
Expand All @@ -184,9 +177,27 @@ Now, also create a compacted time series named _dailyDiffTemp_. This time series
127.0.0.1:6379> TS.CREATE dailyDiffTemp:TLV LABELS type temp location TLV
127.0.0.1:6379> TS.CREATERULE temp:TLV dailyDiffTemp:TLV AGGREGATION range 86400000 21600000
{{< / highlight >}}

</details>

## Return information

{{< multitabs id="ts-createrule-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` when the compaction rule is created successfully.
* [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.

-tab-sep-

One of the following:
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` when the compaction rule is created successfully.
* [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.

{{< /multitabs >}}

## See also

[`TS.DELETERULE`]({{< relref "commands/ts.deleterule/" >}})
Expand Down
19 changes: 15 additions & 4 deletions content/commands/ts.decrby.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,23 @@ Use it only if you are creating a new time series. It is ignored if you are addi
- Setting `RETENTION` and `LABELS` introduces additional time complexity.
</note>

## Return value
## Return information

Returns one of these replies:
{{< multitabs id="ts-decrby-return-info"
tab1="RESP2"
tab2="RESP3" >}}

- [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.
- [] on error (invalid arguments, wrong key type, etc.), or when `timestamp` is not equal to or higher than the maximum existing timestamp
One of the following:
* [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.
* [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.

-tab-sep-

One of the following:
* [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.
* [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.

{{< /multitabs >}}

## See also

Expand Down
27 changes: 19 additions & 8 deletions content/commands/ts.del.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,7 @@ The given timestamp interval is closed (inclusive), meaning that samples whose t

</note>

## Return value

Returns one of these replies:

- [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) - the number of samples that were deleted
- [] 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

## Examples
## Examples

<details open><summary><b>Delete range of data points</b></summary>

Expand Down Expand Up @@ -107,6 +100,24 @@ Delete the range of data points for temperature in Tel Aviv.
{{< / highlight >}}
</details>

## Return information

{{< multitabs id="ts-del-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:
* [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): the number of samples that were deleted.
* [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.

-tab-sep-

One of the following:
* [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): the number of samples that were deleted.
* [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.

{{< /multitabs >}}

## See also

[`TS.ADD`]({{< relref "commands/ts.add/" >}})
Expand Down
19 changes: 15 additions & 4 deletions content/commands/ts.deleterule.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,23 @@ is key name for destination (compacted) time series.

<note><b>Note:</b> This command does not delete the compacted series.</note>

## Return value
## Return information

Returns one of these replies:
{{< multitabs id="ts-deleterule-return-info"
tab1="RESP2"
tab2="RESP3" >}}

- [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) - `OK` if executed correctly
- [] on error (invalid arguments, etc.), or when such rule does not exist
One of the following:
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` when the compaction rule is deleted successfully.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, or when such rule does not exist.

-tab-sep-

One of the following:
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` when the compaction rule is deleted successfully.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, or when such rule does not exist.

{{< /multitabs >}}

## See also

Expand Down
30 changes: 21 additions & 9 deletions content/commands/ts.get.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ is used when a time series is a compaction. With `LATEST`, TS.GET reports the co
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`.
</details>

## Return value

Returns one of these replies:

- [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
- An empty [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) - when the time series is empty
- [] (invalid arguments, wrong key type, key does not exist, etc.)

## Examples

<details open>
Expand Down Expand Up @@ -135,7 +127,27 @@ Get the latest maximum daily temperature (the temperature with the highest times
{{< / highlight >}}

</details>


## Return information

{{< multitabs id="ts-get-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:
* [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.
* An empty [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) when the time series is empty.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, key does not exist, etc.

-tab-sep-

One of the following:
* [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.
* An empty [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) when the time series is empty.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, wrong key type, key does not exist, etc.

{{< /multitabs >}}

## See also

[`TS.MGET`]({{< relref "commands/ts.mget/" >}})
Expand Down
27 changes: 19 additions & 8 deletions content/commands/ts.incrby.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,6 @@ Use it only if you are creating a new time series. It is ignored if you are addi
- Setting `RETENTION` and `LABELS` introduces additional time complexity.
</note>

## Return value

Returns one of these replies:

- [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.
- [] on error (invalid arguments, wrong key type, etc.), or when `timestamp` is not equal to or higher than the maximum existing timestamp

## Examples

<details open><summary><b>Store sum of data from several sources</b></summary>
Expand Down Expand Up @@ -215,9 +208,27 @@ Suppose a sensor ticks whenever a car is passed on a road, and you want to count
(integer) 1658431553109
{{< / highlight >}}

The timestamp is filled automatically.
The timestamp is filled automatically.
</details>

## Return information

{{< multitabs id="ts-incrby-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:
* [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.
* [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.

-tab-sep-

One of the following:
* [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.
* [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.

{{< /multitabs >}}

## See also

[`TS.DECRBY`]({{< relref "commands/ts.decrby/" >}}) | [`TS.CREATE`]({{< relref "commands/ts.create/" >}})
Expand Down
Loading