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
6 changes: 5 additions & 1 deletion content/commands/ts.add.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Unix time is the number of milliseconds that have elapsed since 00:00:00 UTC on

<details open><summary><code>value</code></summary>

is (double) numeric data value of the sample. The double number should follow [RFC 7159](https://tools.ietf.org/html/rfc7159) (JSON standard). In particular, the parser rejects overly large values that do not fit in binary64. It does not accept NaN or infinite values.
is (double) numeric data value of the sample. The double number should follow [RFC 7159](https://tools.ietf.org/html/rfc7159) (JSON standard). In particular, the parser rejects overly large values that do not fit in binary64. It does not accept infinite values. NaN (Not a Number) values are supported starting from Redis 8.6.
</details>

<note><b>Notes:</b>
Expand Down Expand Up @@ -173,6 +173,8 @@ This override is effective only for this single command and does not set the tim
- `MAX`: only override if the value is higher than the existing value
- `SUM`: If a previous sample exists, add the new sample to it so that the updated value is set to (previous + new). If no previous sample exists, the value is set to the new value.

<note><b>NaN Handling (Redis 8.6+):</b> When using `MIN`, `MAX`, or `SUM` policies, an error is returned if there is an existing value in the specified timestamp and either the previous or the new value (but not both) are NaN.</note>

This argument has no effect when a new time series is created by this command.
</details>

Expand All @@ -192,6 +194,8 @@ When not specified: set to the global [IGNORE_MAX_TIME_DIFF]({{< relref "develop

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).

<note><b>NaN Handling (Redis 8.6+):</b> NaN values are never regarded as duplicates when using the `IGNORE` parameters.</note>

</details>

<details open><summary><code>LABELS {label value}...</code></summary>
Expand Down
38 changes: 24 additions & 14 deletions content/commands/ts.createrule.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ arguments:
since: 1.8.0
token: TWA
type: pure-token
- name: countNaN
since: 8.6.0
token: COUNTNAN
type: pure-token
- name: countAll
since: 8.6.0
token: COUNTALL
type: pure-token
name: aggregator
token: AGGREGATION
type: oneof
Expand All @@ -69,7 +77,7 @@ categories:
- kubernetes
- clients
complexity: O(1)
description: Create a compaction rule
description: Create a compaction rule.
group: timeseries
hidden: false
linkTitle: TS.CREATERULE
Expand Down Expand Up @@ -110,19 +118,21 @@ aggregates results into time buckets.

| `aggregator` | Description |
| ------------ | ------------------------------------------------------------------------------ |
| `avg` | Arithmetic mean of all values |
| `sum` | Sum of all values |
| `min` | Minimum value |
| `max` | Maximum value |
| `range` | Difference between the highest and the lowest value |
| `count` | Number of values |
| `first` | Value with lowest timestamp in the bucket |
| `last` | Value with highest timestamp in the bucket |
| `std.p` | Population standard deviation of the values |
| `std.s` | Sample standard deviation of the values |
| `var.p` | Population variance of the values |
| `var.s` | Sample variance of the values |
| `twa` | Time-weighted average over the bucket's timeframe (since RedisTimeSeries v1.8) |
| `avg` | Arithmetic mean of all non-NaN values (ignores NaN values) |
| `sum` | Sum of all non-NaN values (ignores NaN values) |
| `min` | Minimum non-NaN value (ignores NaN values) |
| `max` | Maximum non-NaN value (ignores NaN values) |
| `range` | Difference between the highest and the lowest non-NaN value (ignores NaN values) |
| `count` | Number of non-NaN values (ignores NaN values) |
| `countNaN` | Number of NaN values (since Redis 8.6) |
| `countAll` | Number of all values, both NaN and non-NaN (since Redis 8.6) |
| `first` | Value with lowest timestamp in the bucket (ignores NaN values) |
| `last` | Value with highest timestamp in the bucket (ignores NaN values) |
| `std.p` | Population standard deviation of the non-NaN values (ignores NaN values) |
| `std.s` | Sample standard deviation of the non-NaN values (ignores NaN values) |
| `var.p` | Population variance of the non-NaN values (ignores NaN values) |
| `var.s` | Sample variance of the non-NaN values (ignores NaN values) |
| `twa` | Time-weighted average over the bucket's timeframe (ignores NaN values). Added in RedisTimeSeries 1.8. |

- `bucketDuration` is duration of each bucket, in milliseconds.

Expand Down
6 changes: 4 additions & 2 deletions content/commands/ts.decrby.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ is key name for the time series.

<details open><summary><code>subtrahend</code></summary>

is numeric value of the subtrahend (double).
is numeric value of the subtrahend (double). An error is returned if the subtrahend is NaN.
</details>

<note><b>Notes</b>
Expand All @@ -133,8 +133,10 @@ Unix time is the number of milliseconds that have elapsed since 00:00:00 UTC on
`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 decreased. 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 minus `subtrahend`.

If the time series is empty, the value is set to `subtrahend`.

When not specified, the timestamp is set to the Unix time of the server's clock.

<note><b>NaN Handling (Redis 8.6+):</b> An error is returned if the current value at the maximum existing timestamp is NaN.</note>
</details>

<details open><summary><code>RETENTION retentionPeriod</code></summary>
Expand Down
2 changes: 1 addition & 1 deletion content/commands/ts.get.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ syntax_fmt: TS.GET key [LATEST]
title: TS.GET
---

Get the sample with the highest timestamp from a given time series
Get the sample with the highest timestamp from a given time series. Starting from Redis 8.6, NaN values are included in the results.

[Examples](#examples)

Expand Down
8 changes: 5 additions & 3 deletions content/commands/ts.incrby.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ is key name for the time series.

<details open><summary><code>addend</code></summary>

is numeric value of the addend (double).
is numeric value of the addend (double). An error is returned if the addend is NaN.
</details>

<note><b>Notes</b>
Expand All @@ -132,9 +132,11 @@ Unix time is the number of milliseconds that have elapsed since 00:00:00 UTC on

`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`.

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

When not specified, the timestamp is set to the Unix time of the server's clock.

<note><b>NaN Handling (Redis 8.6+):</b> An error is returned if the current value at the maximum existing timestamp is NaN.</note>
</details>

<details open><summary><code>RETENTION retentionPeriod</code></summmary>
Expand Down
2 changes: 1 addition & 1 deletion content/commands/ts.madd.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Unix time is the number of milliseconds that have elapsed since 00:00:00 UTC on
<details open>
<summary><code>value</code></summary>

is numeric data value of the sample (double). The double number should follow <a href="https://tools.ietf.org/html/rfc7159">RFC 7159</a> (a JSON standard). The parser rejects overly large values that would not fit in binary64. It does not accept NaN or infinite values.
is numeric data value of the sample (double). The double number should follow <a href="https://tools.ietf.org/html/rfc7159">RFC 7159</a> (JSON standard). The parser rejects overly large values that would not fit in binary64. It does not accept infinite values. NaN (Not a Number) values are supported starting from Redis 8.6.
</details>

<note><b>Notes:</b>
Expand Down
2 changes: 1 addition & 1 deletion content/commands/ts.mget.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ syntax_fmt: "TS.MGET [LATEST] [WITHLABELS | SELECTED_LABELS label1 [label1 ...]]
title: TS.MGET
---

Get the sample with the highest timestamp from each time series matching a specific filter.
Get the sample with the highest timestamp from each time series matching a specific filter. Starting from Redis 8.6, NaN values are included in the results.

{{< note >}}
This command will reply only if the current user has read access to all keys that match the filter.
Expand Down
54 changes: 29 additions & 25 deletions content/commands/ts.mrange.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ syntax_fmt: "TS.MRANGE fromTimestamp toTimestamp [LATEST] [FILTER_BY_TS\_Timesta
title: TS.MRANGE
---

Query a range across multiple time series by filters in the forward direction.
Query a range across multiple time series by filters in the forward direction. Starting from Redis 8.6, NaN values are included in raw measurement reports (queries without aggregation).

{{< note >}}
This command will reply only if the current user has read access to all keys that match the filter.
Expand Down Expand Up @@ -240,7 +240,7 @@ When used together with `AGGREGATION`: samples are filtered before being aggrega
<details open>
<summary><code>FILTER_BY_VALUE min max</code> (since RedisTimeSeries v1.6)</summary>

filters samples by minimum and maximum values.
filters samples by minimum and maximum values. `min` and `max` cannot be NaN values.

When used together with `AGGREGATION`: samples are filtered before being aggregated.
</details>
Expand Down Expand Up @@ -291,19 +291,21 @@ per time series, aggregates samples into time buckets, where:

| `aggregator` | Description |
| ------------ | ------------------------------------------------------------------------------ |
| `avg` | Arithmetic mean of all values |
| `sum` | Sum of all values |
| `min` | Minimum value |
| `max` | Maximum value |
| `range` | Difference between maximum value and minimum value |
| `count` | Number of values |
| `first` | Value with lowest timestamp in the bucket |
| `last` | Value with highest timestamp in the bucket |
| `std.p` | Population standard deviation of the values |
| `std.s` | Sample standard deviation of the values |
| `var.p` | Population variance of the values |
| `var.s` | Sample variance of the values |
| `twa` | Time-weighted average over the bucket's timeframe (since RedisTimeSeries v1.8) |
| `avg` | Arithmetic mean of all non-NaN values (ignores NaN values) |
| `sum` | Sum of all non-NaN values (ignores NaN values) |
| `min` | Minimum non-NaN value (ignores NaN values) |
| `max` | Maximum non-NaN value (ignores NaN values) |
| `range` | Difference between maximum non-NaN value and minimum non-NaN value (ignores NaN values) |
| `count` | Number of non-NaN values (ignores NaN values) |
| `countNaN` | Number of NaN values (since Redis 8.6) |
| `countAll` | Number of all values, both NaN and non-NaN (since Redis 8.6) |
| `first` | Value with lowest timestamp in the bucket (ignores NaN values) |
| `last` | Value with highest timestamp in the bucket (ignores NaN values) |
| `std.p` | Population standard deviation of the non-NaN values (ignores NaN values) |
| `std.s` | Sample standard deviation of the non-NaN values (ignores NaN values) |
| `var.p` | Population variance of the non-NaN values (ignores NaN values) |
| `var.s` | Sample variance of the non-NaN values (ignores NaN values) |
| `twa` | Time-weighted average over the bucket's timeframe (ignores NaN values). Added in RedisTimeSeries v1.8. |

- `bucketDuration` is duration of each bucket, in milliseconds.

Expand Down Expand Up @@ -354,16 +356,18 @@ When combined with `AGGREGATION` the `GROUPBY`/`REDUCE` is applied post aggregat

| `reducer` | Description |
| --------- | ----------------------------------------------------------------------------------------------- |
| `avg` | Arithmetic mean of all non-NaN values (since RedisTimeSeries v1.8) |
| `sum` | Sum of all non-NaN values |
| `min` | Minimum non-NaN value |
| `max` | Maximum non-NaN value |
| `range` | Difference between maximum non-NaN value and minimum non-NaN value (since RedisTimeSeries v1.8) |
| `count` | Number of non-NaN values (since RedisTimeSeries v1.8) |
| `std.p` | Population standard deviation of all non-NaN values (since RedisTimeSeries v1.8) |
| `std.s` | Sample standard deviation of all non-NaN values (since RedisTimeSeries v1.8) |
| `var.p` | Population variance of all non-NaN values (since RedisTimeSeries v1.8) |
| `var.s` | Sample variance of all non-NaN values (since RedisTimeSeries v1.8) |
| `avg` | Arithmetic mean of all non-NaN values (ignores NaN values). Added in RedisTimeSeries v1.8. |
| `sum` | Sum of all non-NaN values (ignores NaN values) |
| `min` | Minimum non-NaN value (ignores NaN values) |
| `max` | Maximum non-NaN value (ignores NaN values) |
| `range` | Difference between maximum non-NaN value and minimum non-NaN value (ignores NaN values) |
| `count` | Number of non-NaN values (ignores NaN values) |
| `countNaN`| Number of NaN values (since Redis 8.6) |
| `countAll`| Number of all values, both NaN and non-NaN (since Redis 8.6) |
| `std.p` | Population standard deviation of all non-NaN values (ignores NaN values) |
| `std.s` | Sample standard deviation of all non-NaN values (ignores NaN values) |
| `var.p` | Population variance of all non-NaN values (ignores NaN values) |
| `var.s` | Sample variance of all non-NaN values (ignores NaN values) |

<note><b>Notes:</b>
- The produced time series is named `<label>=<value>`
Expand Down
Loading