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: src/ds/ts/ret-compact.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -4,17 +4,17 @@ When you create a new time series, you have the option to specify a retention pe
4
4
A retention period is the maximum age for samples compared to the highest reported timestamp, in milliseconds.
5
5
Samples are expired based on the difference between their timestamps and the timestamps passed to subsequent `TS.ADD` commands.
6
6
7
-
```redis Create a time series with RETENTION
7
+
```redis:[run_confirmation=true] Create a time series with RETENTION
8
8
TS.CREATE ts RETENTION 86400000 // samples expire after one full day
9
9
```
10
10
11
11
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.
12
12
13
-
```redis Add a sample to ts
13
+
```redis:[run_confirmation=true] Add a sample to ts
14
14
TS.ADD ts 1640995200000 1000.0
15
15
```
16
16
17
-
```redis Add a sample with a much later timestamp
17
+
```redis:[run_confirmation=true] Add a sample with a much later timestamp
18
18
TS.ADD ts 1672560000000 2000.0 // the previous sample will be deleted
19
19
```
20
20
@@ -63,7 +63,7 @@ Note the following:
63
63
64
64
Create time series for each of the five bike shops you've seen previously.
65
65
66
-
```redis Create time series for each bike shop
66
+
```redis:[run_confirmation=true] Create time series for each bike shop
67
67
TS.CREATE bike_sales_1 DUPLICATE_POLICY SUM LABELS region east
68
68
TS.CREATE bike_sales_2 DUPLICATE_POLICY SUM LABELS region east
69
69
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
73
73
74
74
Next, create compaction rules for each shop that will aggregate total daily bike sales using the `sum` aggregator.
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.
683
683
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