Skip to content

Commit 983c9d9

Browse files
Update ret-compact.md
1 parent 85f0191 commit 983c9d9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/ds/ts/ret-compact.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ When you create a new time series, you have the option to specify a retention pe
44
A retention period is the maximum age for samples compared to the highest reported timestamp, in milliseconds.
55
Samples are expired based on the difference between their timestamps and the timestamps passed to subsequent `TS.ADD` commands.
66

7-
```redis Create a time series with RETENTION
7+
```redis:[run_confirmation=true] Create a time series with RETENTION
88
TS.CREATE ts RETENTION 86400000 // samples expire after one full day
99
```
1010

1111
When `RETENTION` set to 0, samples never expire. When `RETENTION` is not specified, the option is set to the global `RETENTION_POLICY` configuration of the database, which by default is zero.
1212

13-
```redis Add a sample to ts
13+
```redis:[run_confirmation=true] Add a sample to ts
1414
TS.ADD ts 1640995200000 1000.0
1515
```
1616

17-
```redis Add a sample with a much later timestamp
17+
```redis:[run_confirmation=true] Add a sample with a much later timestamp
1818
TS.ADD ts 1672560000000 2000.0 // the previous sample will be deleted
1919
```
2020

@@ -63,7 +63,7 @@ Note the following:
6363

6464
Create time series for each of the five bike shops you've seen previously.
6565

66-
```redis Create time series for each bike shop
66+
```redis:[run_confirmation=true] Create time series for each bike shop
6767
TS.CREATE bike_sales_1 DUPLICATE_POLICY SUM LABELS region east
6868
TS.CREATE bike_sales_2 DUPLICATE_POLICY SUM LABELS region east
6969
TS.CREATE bike_sales_3 DUPLICATE_POLICY SUM LABELS region west
@@ -73,7 +73,7 @@ TS.CREATE bike_sales_5 DUPLICATE_POLICY SUM LABELS region west
7373

7474
Next, create compaction rules for each shop that will aggregate total daily bike sales using the `sum` aggregator.
7575

76-
```redis Create compaction rules
76+
```redis:[run_confirmation=true] Create compaction rules
7777
TS.CREATERULE
7878
bike_sales_1 // source key
7979
bike_sales_1_per_day // destination key
@@ -94,7 +94,7 @@ TS.CREATERULE bike_sales_5 bike_sales_5_per_day AGGREGATION sum 86400000
9494

9595
Next, add a bunch of data.
9696

97-
```redis Bulk load bike shop data
97+
```redis:[run_confirmation=true] Bulk load bike shop data
9898
TS.ADD bike_sales_1 1640995200000 0
9999
TS.ADD bike_sales_2 1640995200000 0
100100
TS.ADD bike_sales_3 1640995200000 0
@@ -681,4 +681,4 @@ TS.ADD bike_sales_3 1648062372210 500.78
681681

682682
The sales data you just loaded contains bike sales, one sale per sample, from 2021-12-31T16:00:00 to 2022-03-23T12:06:12. Data was obtained from each of the five bike shops.
683683

684-
In the next part of this tutorial, you'll learn how to retrieve data using a variety of methods.
684+
In the next part of this tutorial, you'll learn how to retrieve data using a variety of methods.

0 commit comments

Comments
 (0)