# TS.INFO

> Show a time series' sample count, first and last samples, retention, memory and labels.

URL: https://docs.hotkv.com/commands/ts-info/

```
TS.INFO key
```

- Group: Time series
- Complexity: O(L), L being the labels
- HotKV Cloud: Performance and Scale plans
- On-Premise: requires the time-series license feature

`TS.INFO` describes the time series `key`.

## Fields

| Field | Meaning |
| --- | --- |
| `key` | The series name. |
| `totalSamples` | Samples ever added, including those retention has since dropped. |
| `firstTimestamp` | Timestamp of the oldest sample kept (`0` before the first sample). |
| `lastTimestamp` | Timestamp of the latest sample (`0` before the first sample). |
| `lastValue` | Value of the latest sample, with six decimals. |
| `retentionMs` | The retention period, `0` for none. |
| `memoryBytes` | Memory taken by the samples kept. |
| `labels` | Array of `[label, value]` pairs. |
| `rules` | Number of [TS.DOWNSAMPLE](https://docs.hotkv.com/commands/ts-downsample/index.md) rules with this series as the source. |

## Return value

A flat array of 18 elements: each field name (bulk string) followed by its
value. The shape is the same in RESP2 and RESP3.

Error replies: `ERR series not found`, and `NOLICENSE ...` without the
`time-series` license feature.

## Examples

```
127.0.0.1:6379> TS.CREATE temp:kitchen LABELS room kitchen
OK
127.0.0.1:6379> TS.ADD temp:kitchen 1700000000000 21.5
(integer) 1700000000000
127.0.0.1:6379> TS.ADD temp:kitchen 1700000060000 22
(integer) 1700000060000
127.0.0.1:6379> TS.INFO temp:kitchen
 1) "key"
 2) "temp:kitchen"
 3) "totalSamples"
 4) (integer) 2
 5) "firstTimestamp"
 6) (integer) 1700000000000
 7) "lastTimestamp"
 8) (integer) 1700000060000
 9) "lastValue"
10) "22.000000"
11) "retentionMs"
12) (integer) 0
13) "memoryBytes"
14) (integer) 32
15) "labels"
16) 1) 1) "room"
       2) "kitchen"
17) "rules"
18) (integer) 0
```

## Compatibility

HotKV's own time series API. `TS.INFO` shares its name with the
RedisTimeSeries command, but reports a different set of fields.

## See also

[TS.CREATE](https://docs.hotkv.com/commands/ts-create/index.md), [TS.RANGE](https://docs.hotkv.com/commands/ts-range/index.md), [TS.LIST](https://docs.hotkv.com/commands/ts-list/index.md)